1

I am trying to use Administrate to create a customizable/flexible admin dashboard for a web app I am working on. I have followed the instructions on https://github.com/thoughtbot/administrate

I keep getting this recurring error:

`block in class_name': undefined method `camelize' for nil:NilClass (NoMethodError)

even though I create a Admin model (as suggested by previous posts and questions). The steps I took:

  1. rails generate model Admin
  2. rake db:migrate
  3. rails generate administrate:install
routes.rb
Rails.application.routes.draw do

  namespace :admin do
    root to: "#index"
  end
  # welcome
  root 'welcome#index'
  get 'welcome/index'
end 

Please let me know if there is anything else I can provide to help you answer the question!

Community
  • 1
  • 1
jshaf
  • 309
  • 1
  • 18

1 Answers1

1

Try deleting generated code from routes.rb:

  namespace :admin do
    root to: "#index"
  end

and run again:

rails generate administrate:install:

Blackcoat77
  • 1,574
  • 1
  • 21
  • 31
  • do I place it back into the routes after deleting it and running the command? – jshaf Dec 14 '16 at 23:08
  • 1
    No need. Just run : `rails generate administrate:install` again and it will generate routes. But before doing it, be sure that you have some models installed. – Blackcoat77 Dec 16 '16 at 04:35
  • 1
    I tried to install administrate, but I run into multiple errors, and dependency problems. I prefer this rails_admin gem instead: (https://github.com/sferik/rails_admin) There is a nice tutorial about administrate from this link: (https://gorails.com/episodes/administrate) – Blackcoat77 Dec 16 '16 at 05:26
  • 1
    yeah I decided I am just going to go with rails_admin. The reason why administrate was so appealing to me was the fact that it is super flexible. But I will just go with rails_admin. It seems like administrate still has some issues it needs to figure out. – jshaf Dec 16 '16 at 06:24
  • 1
    Totally agree. Rails_admin can be flexible too, after you set up properly configuration. On the other side it can be tricky, once CanCanCan and Devise kick in. There are plenty of good tuts around to start with: [link](https://youtu.be/agzm_O-pZFE) [link](https://github.com/sferik/rails_admin/wiki/Cancancan) – Blackcoat77 Dec 16 '16 at 14:07