我需要向simple_form
添加非模型字段。其实几个。但是我得到了这个错误:
ActionView::Template::Error (undefined method `parameter_id_17' for #<ReportDefinition:0x007fdc22aad088>):
这是在fields_for
区块内。我知道我试图使用它的模型未定义。我希望我仍然可以使用simple_form
而不必使用Rails本机标签。
答案 0 :(得分:1)
在你的模特中你可以添加:
attr_accessor :something, :something_else