Branksy
Branksy

Reputation: 101

Scope dropdown options to current_user in Rails Administrate

When editing a form with Thoughtbot's Administrate gem, the dropdown options for a select field or HasMany relationship always display all possible records for a given Model/Association.

However I would only like to display records that are relevant to the current user, and preferably without hacking the Administrate controllers or views.

Pundit scopes using 'resolve admin' only seem to affect index pages, not forms.

Has anyone come across or resolved this issue elegantly?

Upvotes: 5

Views: 464

Answers (0)

Related Questions