Skip to content
Vladislav Melanitskiy edited this page May 3, 2017 · 5 revisions

How to install

  1. Add gem rademade_admin to Gemfile (and bcrypt for secure passwords)

    # app/Gemfile

    gem 'rademade_admin', github: 'Rademade/rademade_admin', :branch => 'feature/rails-5'
    gem 'bcrypt', '~> 3.1.7'

    bundle

  2. Update config/initializers/assets.rb and install assets:

    # app/config/initializers/assets.rb

    Rails.application.config.assets.precompile += %w(rademade_admin.css rademade_admin.js)
    

    rake rademade_admin:bower:install

  3. Mount rails engine at routes.rb

    # app/config/routes.rb

    mount RademadeAdmin::Engine => '/admin'
    
  4. Create User model (email field required)

    rails g model User email password_digest

    # app/models/user.rb

    include RademadeAdmin::UserModule
    has_secure_password
    
  5. Add rademade_admin initializer

    touch config/initializers/rademade_admin.rb

    # app/config/initializers/rademade_admin.rb

    RademadeAdmin.configure do |config|
      config.admin_class = User
    end
    
  6. Create admin controller

    mkdir app/controllers/rademade_admin

    touch app/controllers/rademade_admin/users_controller.rb

    # app/controllers/rademade_admin/users_controller.rb

    class RademadeAdmin::UsersController < RademadeAdmin::ModelController
    end
    
  7. Add admin_resources to routes.rb

    # app/config/routes.rb

    namespace :rademade_admin, :path => 'admin' do
      admin_resources :users
    end
    
  8. Finalizing

    rails s

    #and don't forget to create first User through rails c

Welldone!

Enjoy rademade_admin

Clone this wiki locally