http://localhost:3000/admin/roles |
gem 'the_role', '~> 3.0.0'
or
gem 'the_role_api', '~> 3.0.0'
gem 'the_role_management_panel', '~> 3.0.0'
and after that
bundle
config/initializers/the_role.rb
TheRole.configure do |config|
# [ Devise => :authenticate_user! | Sorcery => :require_login ]
config.login_required_method = :authenticate_user!
# layout for Management panel
config.layout = :the_role_management_panel
# ... code ...
end
config/config/routes.rb
RailsApp::Application.routes.draw do
# ... code ...
TheRoleManagementPanel::Routes.mixin(self)
end
HAML
- if current_user
- if current_user.admin? || current_user.moderator?(:roles)
= link_to 'TheRole Manage Panel', admin_roles_path