1
我正在使用Rails Admin创业板。我有以下两种模式:Rails管理员和has_and_belongs_to_many
class Category < ActiveRecord::Base
attr_accessible :description, :name
has_and_belongs_to_many :experiences
end
class Experience < ActiveRecord::Base
attr_accessible :description, :city_id, :price, :title, :user_id
attr_accessible :categories
validates :title, :description, :user_id, :presence => true
belongs_to :user
belongs_to :city
has_and_belongs_to_many :categories
end
在Rails管理员中,我无法将类别添加到现有的体验中。在一个特定的经验的编辑网站,我看到:
正如你看到的,我不能选择任何类型,即使我已经创建了几个类别。
在类别形式。你可以设置体验吗?或者只是在协会的一方? –