Search code examples
ruby-on-railsrubyhas-manyrails-adminbelongs-to

Rails admin hide buttons in has_many nested form


I am using Rails Admin. I have three models:

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

and what's being displayed:

Image

I would like to hide the buttons "Add a new tag" and "Edit this tag". How could I do that?


Solution

  • Try

    field :tag do 
      inline_add false
      inline_edit false
    end