Skip to content

Instantly share code, notes, and snippets.

@grillermo
Created March 9, 2017 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grillermo/9c0e5521a5e5b9361846128eb272c8c0 to your computer and use it in GitHub Desktop.
Save grillermo/9c0e5521a5e5b9361846128eb272c8c0 to your computer and use it in GitHub Desktop.
A has many rails admin field with the remove association button gone.
require 'rails_admin/config/fields/association'
module RailsAdmin
module Config
module Fields
module Types
class NotRemovableHasManyAssociation < RailsAdmin::Config::
Fields::
Types::
HasManyAssociation
# Register field type for the type loader
RailsAdmin::Config::Fields::Types.register(self)
register_instance_option :removable? do
false
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment