activeadmin_addons icon indicating copy to clipboard operation
activeadmin_addons copied to clipboard

Modify state_column to toggle aasm values

Open ldlsegovia opened this issue 7 years ago • 1 comments

Same as in this issue https://github.com/platanus/activeadmin_addons/issues/148 but with machine states

The select input should to show allowed actions related with the given state:

Suppose we have:

  aasm do
    state :pending, initial: true
    state :accepted, :rejected

    event :accept do
      transitions from: :pending, to: :accepted
    end

    event :reject do
      transitions from: :pending, to: :rejected
    end
  end

with :pending state we will show a select box with the options: "accept" and "reject". with :accepted state we will show no options. with :rejected state we will show no options.

ldlsegovia avatar Sep 03 '17 16:09 ldlsegovia

Hi guys, Thanks for working on awesome gem, I've worked with AA long time and admit this is the best one !

My current project was required to create AASM selector depends on permission of CanCan and current events.

Once ill have some time in my 60 hours per week workday ill submit it as addon to this gem :)

In the meantime, if somebody looking for this functionality you are welcome to use this gist: https://gist.github.com/alexey/446c6c4ce2a5af0f4fb6851e6d6d514e

Its created fast so please pardon for some ugly methods(will rewrite it soon to much better format)

alexey avatar May 13 '18 13:05 alexey