Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.3k
Dynamic I18n labels in Active Admin filters render as Proc objects instead of translated strings#8718
-
Active Admin Version: [ Description: Steps to Reproduce: ActiveAdmin.registerItemdofilter:status,as::select,collection:Item.statuses.keys,label:proc{I18n.t("activerecord.attributes.item.status")}end Using a Lambda: ActiveAdmin.registerItemdofilter:status,as::select,collection:Item.statuses.keys,label:->{I18n.t("activerecord.attributes.item.status")}end Expected Behavior: Actual Behavior: |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
Replies: 1 comment 10 replies
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hello, To address your question:
|
BetaWas this translation helpful?Give feedback.
All reactions
-
Thanks. Found it and I'm able to reproduce So we have an issues with
But this is also an issue on V4 @mgrunberg I'm not very familiar with this part, I'm quite suprised that |
BetaWas this translation helpful?Give feedback.
All reactions
-
@tagliala I'm not very familiar with this part, but this also took me by surprise. I did a quick test with the test app on master and label works as expected with ransack predicates. It's just a problem of scopes. Compared with the offending line you highlighted, ransack predicates (
activeadmin/lib/active_admin/views/components/active_filters_sidebar_content.rb Lines 39 to 44 in6234aa4
activeadmin/lib/active_admin/filters/active_filter.rb Lines 27 to 38 in6fcc9d7
I can't say why scopes are handled differently.@javierjulio do you have an insight on this? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Sorry, I don't. I do recall changes around this over the years to make improvements so I'm not surprised if some cases are missing or not handled. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
@tagliala@mgrunberg@javierjulio, is there any update on how we can handle the scopes? |
BetaWas this translation helpful?Give feedback.
All reactions
-
I think a fix is required, but at the moment I cannot allocate time for a PR. Also, V4 and V3 are different, so we should have two different fixes. I would investigate why scopes are returned as hashes and then try to submit a PR with specs |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
