Forum: Ruby on Rails rails admin: how to set it to use custom controller instead of devise controller?

5a41028798f4e263c2d0692f5b1847ec?d=identicon&s=25 Monserrat Foster (Guest)
on 2013-10-02 22:39
(Received via mailing list)
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.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.