Sha256: 7ed5cad040658be0676c8dc1703640db3321aa0bcbf6e924a8ee63b42d6b8cf9
Contents?: true
Size: 1.47 KB
Versions: 7
Compression:
Stored size: 1.47 KB
Contents
# Nice Admin A prebuilt and skinned admin centre. Because, making an admin for everything is really annoying. # Install simply add the following to your gemfile ```ruby gem 'nice_admin' ``` Then add the following to your config/environments/production.rb ```ruby config.assets.precompile += %w( nice_admin.js nice_admin.css ) ``` # Configuring Create an initializer called nice_admin.rb in config/initialisers, inside you can set the following.. ```ruby NiceAdmin.site_title = 'MySiteName - Admin' NiceAdmin.site_name = 'MySiteName' ``` Create an admin controller in your application and have it inherit from nice_admin like so Notice this is where you also define the navigation items and include any authenticate you may need. Nice admin DOES NOT DO AUTHENTICATION, this before filter is from devise ```ruby class AdminController < NiceAdminController # devise before filter before_filter :authenticate_admin! # defining nav items nice_admin_nav do |nav| nav.item 'Home', '/admin' nav.item 'Admins', '/admin/admins' end end ``` Now, when making admin controller they should inherit from your AdminController nice_admin supports pagination via kaminari automatically ```ruby class ArticlesController < AdminController def index @admins = Admin.order('created_at DESC').page(params[:page]).per(20) end end ```
Version data entries
7 entries across 7 versions & 1 rubygems