I’m trying to make rails_admin use the custom registration controller
that
I used, instead of the devise one.
Meaning when I enter with /users/sign_up it uses the custom controller
that
has a method that I need, however if I create a user with rails_admin it
seems to use the devise controller and not mine. I tried to “update”
rails_admin using rails g rails_admin:install, no luck.
routes.rb
Siteconfigurationlistgenerator::Application.routes.draw do
devise_for :users, :controllers => {:registrations => “registrations”}
mount RailsAdmin::Engine => ‘/admin’, :as => ‘rails_admin’
registration controller:
class RegistrationsController < Devise::RegistrationsController
after_filter :create_folder, :only => :create
def new
super
end
def create
build_resource(sign_up_params)
if resource.save
if resource.active_for_authentication?
set_flash_message :notice, :signed_up if is_navigational_format?
sign_up(resource_name, resource)
respond_with resource, :location =>
after_sign_up_path_for(resource)
else
set_flash_message :notice,
:“signed_up_but_#{resource.inactive_message}” if is_navigational_format?
expire_session_data_after_sign_in!
respond_with resource, :location =>
after_inactive_sign_up_path_for(resource)
end
else
clean_up_passwords resource
respond_with resource
end
end
def update
super
end
def create_folder
path = Pathname.new(Rails.root.to_s + ‘/tmp/’)
directory_name = resource.email
Dir.mkdir(path.to_s + directory_name.to_s)
endend
How can I make rails_admin take the custom controller instead of the
devise
one? I really need that create_folder executed.