custom registrations controller -> RoutingError

686 views
Skip to first unread message

marcel

unread,
Aug 22, 2010, 3:09:17 PM8/22/10
to Devise
Hi there,

I'm currently building an app using devise 1.1.1 wit Rails 3.0.0.rc
During the registration process of a new user, the user first selects
a plan. This one has to be remembered through the user registration
(users/sign_up) and after the successful sign up he will be redirected
to a separate page for all the credit card informations needed where i
need to now the plan he selected before the registration.
I guess the only way to do this in devise is to overwrite the
registrations controller.
I created the following class class

class Users::RegistrationsController < Devise::RegistrationsController
def new
end
end

and I modified the routes.rb:
devise_for :users, :controllers => { :registrations => "users/
registrations"}

The layout files are copied from devise/registrations to users/
registrations

but when i access /users/sign_up I get the following error:

Started GET "/users/sign_up" for 127.0.0.1 at 2010-08-22 20:58:40
+0200
ActionController::RoutingError (uninitialized constant Users):

any ideas?

many thanks,
marcel

José Valim

unread,
Aug 22, 2010, 3:11:36 PM8/22/10
to plataforma...@googlegroups.com
Your controller is probably at app/controllers/registrations_controller.rb, but due to the namespacing, it should be app/controllers/users/registrations_controller.rb

--
José Valim

Director of Engineering - Plataforma Tecnologia
Know more about us: http://plataformatec.com.br/en/

marcel

unread,
Aug 22, 2010, 3:22:08 PM8/22/10
to Devise
fast and perfect :-)

many thanks for the solution!

Aurimukas

unread,
Sep 1, 2010, 10:42:12 AM9/1/10
to Devise
I'm getting uninitialized constant Registration :D
any ideas?

On Aug 22, 10:11 pm, José Valim <jose.va...@gmail.com> wrote:
> Your controller is probably at app/controllers/registrations_controller.rb,
> but due to the namespacing, it should be
> app/controllers/users/registrations_controller.rb
>
> --
> José Valim
>
> Director of Engineering - Plataforma Tecnologia
> Know more about us:http://plataformatec.com.br/en/
>

Miguel

unread,
Sep 22, 2010, 4:38:37 PM9/22/10
to Devise
Me too.
I'm also getting an error in this...
And when I runs, it actually does not execute the new action, instead
it executes the parent action.
> > > devise_for :users, :controllers => { :registrations=> "users/
> > >registrations"}
>
> > > The layout files are copied from devise/registrationsto users/
Reply all
Reply to author
Forward
0 new messages