calling transitions via forms

19 views
Skip to first unread message

Christopher Hobbs

unread,
Nov 16, 2011, 4:55:18 PM11/16/11
to PluginAWeek: Talk
Is it possible to call a transition from a form dropdown? I'm
currently populating a form in my application (Rails 3.0.10) using
#state_paths.to_states, but this clearly doesn't trigger any
transitions. The #state_events and #state_transitions methods don't
seem to be getting me anywhere either.

I've considered using virtual attributes or something, but I almost
think that's like killing a fly with a cannon.

Thanks!

Aaron Pfeifer

unread,
Nov 16, 2011, 4:57:07 PM11/16/11
to pluginaw...@googlegroups.com
Hi Christopher,

Thanks for the question.  There is an example of this in the project @ https://github.com/pluginaweek/state_machine/tree/master/examples/rails-rest.

Hope this helps!

Best,
Aaron

Christopher Hobbs

unread,
Nov 17, 2011, 12:26:40 PM11/17/11
to pluginaw...@googlegroups.com
> --
> You received this message because you are subscribed to the Google Groups
> "PluginAWeek: Talk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pluginaweek-talk/-/j_TQ5T05MWUJ.
> To post to this group, send email to pluginaw...@googlegroups.com.
> To unsubscribe from this group, send email to
> pluginaweek-ta...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pluginaweek-talk?hl=en.
>


Outstanding! Now I just need to work that into formtastic input and
I'll be all set. Thanks for the input!
--
Christopher M. Hobbs
http://altbit.org

Reply all
Reply to author
Forward
0 new messages