Devise: NoMethod Error & user_signed_in

前端 未结 4 740
陌清茗
陌清茗 2020-12-18 15:25

I\'m trying to use user_signed_in? to add a login area to my rails 3 application using devise 1.1.3 and I get a NoMethodErrorin Rules#index

<% if user_sig         


        
相关标签:
4条回答
  • 2020-12-18 15:56

    You seem to be missing the call to devise :database_authenticatable in your User model.

    Also, a good way to get started with devise is to look at the excellent RailsCasts by Ryan Bates : Introducing Devise.

    0 讨论(0)
  • 2020-12-18 16:08

    I had the exactly the same issue. undefined local variable or method 'edit_user_registration_path'

    However, I have devise :database_authenticatable, but not :registerable. After I added the :registerable everything works!

    0 讨论(0)
  • 2020-12-18 16:11

    It also may happen that your trying to call that route from another engine, so in that case you have to specify the context for that route, like main_app.edit_user_registration_path.

    0 讨论(0)
  • 2020-12-18 16:12

    What is the name of the model you generated Devise for?

    If you called it something else instead of User, you might want to check out http://groups.google.com/group/plataformatec-devise/msg/67f1eb5a571b6136

    0 讨论(0)
提交回复
热议问题