scarfacedeb / rails_admin_globalize_field

Tabbed interface and custom field type for globalize translations for Rails_admin
MIT License
50 stars 60 forks source link

NoMethodError (undefined method `defined' for nil:NilClass): #29

Closed zhisme closed 5 years ago

zhisme commented 6 years ago

Hey there.

config.model 'Model::Translation' do
    visible false
    configure :locale, :hidden do
      help ''
    end
    include_fields :locale, :title, :desc
  end

When you add this to rails_admin config you have the following error.

NoMethodError (undefined method `defined' for nil:NilClass):
config/initializers/rails_admin.rb:18:in `block (2 levels) in <top (required)>'

Solution to fix this is to remove :desc key. So it will work if you change

    include_fields :locale, :title, :desc

to

    include_fields :locale, :title

So readme is a bit confusing about all this stuff.

This works in ruby 2.4.3 rails 5.1.4 rails_admin 1.2.0