I install rails admin and include all model in active record in rails admin,
first time, when install rails admin display me this error
NoMethodError in RailsAdmin::MainController#index
undefined method `per_page_kaminari' for #<ActiveRecord::Relation:0x00000006713e18>
and fixed it by added this configure
Kaminari.configure do |config|
config.page_method_name = :per_page_kaminari
end
when install acts_as_taggable_on gem in project, rails admin did't add tag model in it ( i added field tags_list in other model), but i want to add tag model in rails admin to manage tags (index,create,edit and destroy)..
I added this line
config.included_models = ['ActsAsTaggableOn::Tag']
in rails_admin.rb and it display me tag model in dashboard, but when open list tags, it display me again this error
NoMethodError in RailsAdmin::MainController#index
undefined method `per_page_kaminari' for #<ActiveRecord::Relation:0x00000006713e18>
what should i do to add tag model in rails admin and manage tags ?!
The exact same issue occurs with ActiveAdmin: Manage acts_as_taggable tags with activeadmin. I solved it with the same solution:
Add an initializer to
config/initializers
with the custom Kaminari code:Create a new class in
app/models
calledtag.rb
:Use the
Tag
model instead ofActsAsTaggableOn::Tag
in RailsAdmin config:Here's my solution with rails 4 and fields configuration (must be before the
congig.included_models
call):I had to solve the same issue here. I used the gem 'rails_admin_tag_list' but latest version from rubygem is not updated for rails 4 (doesnt support RailsAdmin Property). So you need to get the one from master that include the fix.
Indeed add:
and
then choose the config for tag list: