Having a buckload of code to authorize users on your application is something you may like or not.
Speaking for myself I hate it. But I still love rails_admin
, here's how you install it without devise. Thanks to phoet for providing the hints in the gist I have forked from.
do NOT add devise
gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"
bundle install
It works and just does not install devise.
You may also want to $ rm config/locales/devise*
.
rake rails_admin:install
rake db:migrate
In config/initializers/rails_admin.rb
:.
require "rails_admin/application_controller"
module RailsAdmin
class ApplicationController < ::ApplicationController
before_filter :is_admin?
private
def is_admin?
if current_user.nil? || !current_user.admin?
head(:forbidden)
false
end
end
end
end
This ain't working for me, as I run the installer it prompts for devise and it force devise installation.
To make it work, I had to run the installer, that fails, while failing I've removed everything dealing with devise, that repeat the installer and migrate, that way worked.
I think would be better to have a proper fork without devise at all. Thanks ;)