rails simple_nested_form_for fields_for错误的参数数量
所以我正在使用rails 3.1构建一个表单
collection_url, :html=>{:multipart => true}) do |f| %> "form", :locals => { :f => f } %>
但部分中的这一行导致了问题:
Badges
// this following line is raising the error "wrong number of arguments (4 for 3)" 'certification', :locals => { :f => certification_form } %>
所以这是模型:
class Person :destroy, :order=>:position has_many :certificates, :through=>:certifications accepts_nested_attributes_for :certifications, :allow_destroy => true end
控制器正在使用inheritance的资源gem。
怎么了? 谢谢您的帮助。
我遇到了同样的问题,直到我意识到gem与git上的版本已经过时了。 我只是手动更新了gem文件和git上的问题并修复了问题!
imorsi是正确的,这是我如何做到的:
gem“nested_form”,:git =>’git://github.com/ryanb/nested_form.git’
我也删除并重新捆绑了gem,但我怀疑没有必要。 gem安装后不要忘记重启服务器。
我试过了,但没有奏效
所以我最终做了“捆绑打开nested_form”并从github复制粘贴