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