2
我正在使用https://github.com/plataformatec/simple_form并试图发送一个额外的参数。我有一个Task,List和ListTask模型,在列表的新页面中,我希望能够插入将要添加的任务数量。提交时,会将您发送到填充了正确表格数量的新list_task页面。simple_form发送一个额外的参数
=simple_form_for @list do |s|
=s.input :title
=s.input :task_count
=s.button :submit
这将产生一个错误undefined method task_count
,这是有意义的,因为它不是在列表的方法。
非常感谢,这工作完美。我不需要列,因为一旦创建列表,我就可以使用count方法。 – trev9065 2012-03-22 20:38:08
这在Rails 4中仍然有效吗? – Jeff 2016-05-25 04:27:31
我正在使用Rails 4.2.5,它仍然有效。 – 2016-10-12 01:27:14