Closed hube closed 8 years ago
@hube I just tested config similar to the one in README and it worked.
Do you have configure/field :locale, :hidden
line in Translation model config block?
Can you provide your rails_admin config, and rails_admin version.
This was on rails 4.2.3, rails_admin 0.7.0, and rails_admin_globalize_field 0.3.2.
The config that I am using is this:
RailsAdmin.config do |config|
config.model 'Charity::Translation' do
visible false
include_fields :locale, :description, :name
field :locale, :hidden do
help ''
end
field :name
field :description
end
end
Previously, I had configure :locale, :hidden...
when I ran into the issue
@hube Now I see what was the issue.
Calling field
methods instead of configure
resets rails_admin fields list.
So rails_admin only include those fields that you specify with field
call.
In other words, include_fields
line was ignored, because you called field
instead of configure
afterwards.
If you move include_fields
below the field
calls, everything would work as expected.
But from my own experience, it's safer to use configure
+ include_fields
to prevent such issues.
@scarfacedeb At the time that I ran into #10, I was using configure
instead of field
. Anyway, I'm no longer able to reproduce the issue and now I do need to use field
for additional configuration of attributes. Thanks for looking into this
Ran into #10, turns out my config was wrong. Fixed this in the README