You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bbenezech edited this page Nov 29, 2011
·
25 revisions
Ordered associations
For has\_many/has\_and\_belongs\_to\_many/has\_many :through
Orderable can be enabled on filtering multiselect fields (has_many, has_many :through & has_and_belongs_to_many associations), allowing selected options to be moved up/down.
RailsAdmin will handle ordering in and out of the form.
You'll need to handle ordering in your model with a position column for example. See here for a comprehensive ActiveRecord example with a has_many :through association.
Multiselect
You can edit related objects in filtering-multiselect by double-clicking on any visible item in the widget.
Avoiding edit recursions on inverse associations
If you set the :inverse_of option on your relations, RailsAdmin will automatically populate the inverse relationship
in the modal creation window. (link next to :belongs_to and :has_many multiselect widgets)
It will also hide the inverse relation on nested forms. As a good practice, you should always set :inverse_of options. It will help ActiveRecord performances and RailsAdmin will take advantage of its definition.
Readonly
:readonly options are automatically inferred on associations fields and won't be editable in forms.