-
Notifications
You must be signed in to change notification settings - Fork 15
Install
-
Add gem
rademade_admin
to Gemfile (andbcrypt
for secure passwords)# app/Gemfile
gem 'rademade_admin', github: 'Rademade/rademade_admin', :branch => 'feature/rails-5' gem 'bcrypt', '~> 3.1.7'
bundle
-
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
-
Mount rails engine at
routes.rb
# app/config/routes.rb
mount RademadeAdmin::Engine => '/admin'
-
Create User model (
email
field required)rails g model User email password_digest
# app/models/user.rb
include RademadeAdmin::UserModule has_secure_password
-
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
-
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
-
Add admin_resources to
routes.rb
# app/config/routes.rb
namespace :rademade_admin, :path => 'admin' do admin_resources :users end
-
Finalizing
rails s
#and don't forget to create first User through
rails c
Welldone!
Enjoy rademade_admin