使用带有pluginaweek/state_machine的collection_select设置我的状态
如何创建一个collecton_select下拉列表来设置表单中资源的状态?
现在我有
<%= f.collection_select :state, Ticket.state.all, :event, :state_name_humanize, :prompt => true %>
(pluginaweek可以制作一个“state_machine入门”教程吗,我真的很喜欢使用它,但我是一个nube......)
How do I create a collecton_select drop down to set the state of a resource in a form?
right now 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 . . .)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从 示例 中,集合选择应如下所示:
<%= f.collection_select :access_state_event, @user.access_state_transitions, :event, : human_event, :include_blank => “不要更改”%>
还想查看活动记录的简单示例/教程
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