Tag: formtastic activeadmin

ActiveAdmin与has_many问题; 未定义的方法'new_record?'

我正在尝试为与Step具有has_many关系的食谱模型自定义ActiveAdmin表单。 class Recipe < ActiveRecord::Base has_many :steps end class Step < ActiveRecord::Base acts_as_list :scope => :recipe belongs_to :recipe end 我在我的ActiveAdmin文件中有以下关系: form do |f| f.has_many :steps do |ing_f| ing_f.inputs end end 我尝试加载表单时引发以下错误: 未定义的方法`new_record?' 为零:NilClass 我已经把它隔离到has_many方法,但我迷失了过去。 任何意见和帮助,将不胜感激!