Reputation: 1211
How can I customise model name in ActiveAdmin filter here?
This way doesn't work:
activerecord:
models:
category:
one: "категория"
other: 'категории'
Upvotes: 1
Views: 1953
Reputation: 6786
Active Admin uses formtastic to render filter as like the form fields. So you can customize you filters as you like as the formtastic'c customization options are really handy. For example. to change filters label: just use label: 'YOUR CUSTOM LABEL'
option in filter method. You can use translations there as well
Upvotes: 0
Reputation: 11929
ActiveAdmin uses metasearh ,so next rule works for me. (destination - parent model, rateplan - nested model) Example:
en:
activerecord:
attributes:
destination:
rateplan: "RATEPLAN LOCALIZED NAME"
more info: https://github.com/ernie/meta_search#localization
UPD.
One more soulution is using fortastic rules for internalizaton
en:
formtastic:
labels:
rateplan: "RATEPLAN LOCAIZED"
more info: https://github.com/justinfrench/formtastic#internationalization-i18n
Upvotes: 0
Reputation: 5060
filter :title, :label => "Change me"
filter :description, :label => "Change Me"
filter :user, :label => "Change Me"
You could also use I18n.t
if you wanted to
filter :title, :label => (I18n.t "some.key.here")
Upvotes: 1