Reputation: 326
I've followed this:
https://github.com/sferik/rails_admin
And I think I've done everything needed, bundle install, rake db:migrate etc but I can't get rid of:
undefined local variable or method "rails_admin" for #<#<Class:0x0055e4c3e49c30>:0x0055e4c2e61db8>
Upvotes: 5
Views: 1204
Reputation: 86
have you tried to fix your route.rb
you can use this configuration :
devise_for :admins
mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
Upvotes: 2
Reputation: 11216
Make sure you follow the setup instructions
rails g rails_admin:install
Also can you post the helper method code which is raising the error?
Try changing this in your haml file
#change
rails_admin.url
#to
rails_admin_url
Upvotes: 2
Reputation: 4609
You need to add the dashboard to the list of actions on your initializers/rails_admin.rb like this
RailsAdmin.config do |config|
config.actions do
dashboard
end
end
Upvotes: 1
Reputation: 1060
try using href as below. I think it should work if other things are proper.
href="#{main_app.url_for(action: action.action_name, controller: 'rails_admin/main',
model_name: abstract_model.try(:to_param). id: (object.try(:persisted?) && object.try(:id) || nil))}"
Upvotes: 1