Model concern

12 views
Skip to first unread message

Andy Kriger

unread,
May 29, 2019, 9:20:32 AM5/29/19
to rails_admin
I want to move my model configuration into a concern. Though I have everything in place, the concern is not being used and I'm seeing the default behavior for the model list in RailsAdmin. Am I missing something?

config/initializers/rails_admin.rb
config.included_models = [:MyModel]

app/models/concerns/rails_admin/my_model.rb
module RailsAdmin::MyModel
  extend ActiveSupport::Concern


  included do
    rails_admin do
      weight 210
      navigation_icon "icon-list"
      list do
        # my fields
      end
    end
  end
end

app/models/my_model.rb
class MyModel
  include ::RailsAdmin::MyModel
end
Reply all
Reply to author
Forward
0 new messages