当我使用belongs_to relation
时,我收到以下错误Admin :: PropertyDetailsController #index中的NoMethodError #AdminUser的未定义方法`property_types':0x00000005e59a70
请帮助解决问题。
我使用的是带有ruby 2.0.0p247和Rails 4的ActiveAdmin 0.60。
的Gemfile: gem'activeadmin',github:'gregbell / active_admin',branch:'rails4'
ActiveAdmin.register PropertyDetail do
belongs_to :property_type
menu :label => "Latest Properties in the Town"
controller do
def permitted_params
params.permit(:property_detail => [:title ,:description, :image_url, :price, :land_area, :land_unit, :contact_id, :property_type_id, :purpose_id])
end
end
index do
column :title
column :description
column :image_url
column :price, :sortable => :price do |property_detail|
div :class => "price" do
number_to_currency property_detail.price
end
end
end
form :partial => "form"
end
ActiveAdmin.register PropertyType do
end
答案 0 :(得分:0)
我在github上发布了同样的问题并且已经解决了。你可以在
看到解决方案