开发者

set my state with collection_select with pluginaweek/state_machine

How do I create a collecton_select drop down to set the state of a resource in a form?

right n开发者_如何转开发ow I have

<%= f.collection_select :state, Ticket.state.all, :event, :state_name_humanize, :prompt => true %>

(could pluginaweek make a 'getting started with state_machine' tutorial, I am really hot on using it, but I am a nube . . .)


From the example a collection select should look like this: <%= f.collection_select :access_state_event, @user.access_state_transitions, :event, :human_event, :include_blank => "don't change" %>

Would also like to see a simple example/tutorial for active record

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜