Created
March 9, 2017 17:04
-
-
Save grillermo/9c0e5521a5e5b9361846128eb272c8c0 to your computer and use it in GitHub Desktop.
A has many rails admin field with the remove association button gone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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