ActiveAdmin with has_many problem; undefined method 'new_record?'

喜夏-厌秋 提交于 2019-11-29 23:25:58
Dan Gurgui

go to your Recipe model and add the following line

accepts_nested_attributes_for :steps

The line is required by formtastic, not active admin. Check https://github.com/justinfrench/formtastic for formtastic documentation

class Recipe < ActiveRecord::Base

    attr_accessible :step_attributes

    has_many :steps

    accepts_nested_attributes_for :steps

end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!