undefined method `authenticate_user!' on Rails 3 app

4,386 views
Skip to first unread message

Nicholas Faiz

unread,
Sep 1, 2010, 8:55:18 AM9/1/10
to Devise
Hi,

I've checked my configuration several times, but seem unable to access
any of the Devise::Controllers::Helpers methods in my controllers in
my Rails 3 app..

What steps am I supposed to follow to ensure this will happen? At the
moment I'm simply running 'rails generate devise:install'.

Additionally, I've tried including the Helpers module into my
controllers. No joy.

Thanks,
Nicholas

José Valim

unread,
Sep 1, 2010, 9:01:43 AM9/1/10
to plataforma...@googlegroups.com
authenticate_user! is only available after you call `rails g devise User`.
Try following the steps as in the README and you should be ok!

--
José Valim

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

Nicholas Faiz

unread,
Sep 1, 2010, 9:14:32 AM9/1/10
to Devise
The problem was that my user model is namespaced. In this case it's
called Inkling::User. So the way the behaviours were generated and
added to the controllers made it, instead, authenticate_inkling_user!

It would be great to have these things mentioned in documentation.

Cheers,
Nicholas


On Sep 1, 11:01 pm, José Valim <jose.va...@gmail.com> wrote:
> authenticate_user! is only available after you call `rails g devise User`.
> Try following the steps as in the README and you should be ok!
>
> --
> José Valim
>
> Director of Engineering - Plataforma Tecnologia
> Know more about us:http://plataformatec.com.br/en/
>

José Valim

unread,
Sep 1, 2010, 9:20:48 AM9/1/10
to plataforma...@googlegroups.com
It is documented in devise_for method:


If you think the documentation could be better, patches are welcome!


--
José Valim

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


Nicholas Faiz

unread,
Sep 1, 2010, 8:46:00 PM9/1/10
to Devise
Jose - okay, thanks.

I've ran into namespacing issues twice, and had read the main doc. at
github. If I have time I'll try to add to that - just a simple mention
that you'll need some extra config. for namespacing would help in the
readme.

On Sep 1, 11:20 pm, José Valim <jose.va...@gmail.com> wrote:
> It is documented in devise_for method:
>
> http://github.com/plataformatec/devise/blob/master/lib/devise/rails/r...
>
> <http://github.com/plataformatec/devise/blob/master/lib/devise/rails/r...>If
> you think the documentation could be better, patches are welcome!
>
> --
> José Valim
>
> Director of Engineering - Plataforma Tecnologia
> Know more about us:http://plataformatec.com.br/en/
>
Reply all
Reply to author
Forward
0 new messages