Skip to content

Conversation

cprodhomme
Copy link
Contributor

@cprodhomme cprodhomme commented Oct 26, 2023

for activeadmin_addons v1

Motivation / Background

I have this architecture :

Account
User
Item

Item -> UserItem -> User -> Account

I want to filter Item and search only on Account url like this :

  filter :user_id,
         as: :search_select_filter,
         url: proc { admin_accounts_path },
         fields: %i(email),
         display_name: "email",
         minimum_input_length: 2,
         order_by: "email_asc",
         primary_key: "user_id"

(obviously, to do that, i have add user_id in the json response of accounts#index)

Detail

This Pull Request add primary_key option for search select

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a concise description of what changed and why.
  • Tests are added or updated if you fix a bug or add a feature.
  • Documentation has been added or updated if you add a feature or modify an existing one.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature (under the "Unreleased" heading if this is not a version change).
  • My changes don't introduce any linter rule violations.

for activeadmin_addons v1
@cprodhomme
Copy link
Contributor Author

I can made another PR for the v2 if you want with the same usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant