我正在使用Rails Admin。我有三种模式:
class Tag < ActiveRecord::Base
has_many :tags_users, :dependent => :destroy
end
class TagsUser < ActiveRecord::Base
belongs_to :user_spot, :inverse_of => :tags_users
belongs_to :tag
end
class UserSpot < ActiveRecord::Base
has_many :tags_users, :inverse_of => :user_spot
accepts_nested_attributes_for :tags_users, :allow_destroy => true
end
以及显示的内容:
我想隐藏按钮“添加新标记”和“编辑此标记”。我怎么能这样做?
答案 0 :(得分:2)
尝试
@team = Team.find params[:team_id]