Veske
Veske

Reputation: 557

NoMethodError when creating new user in rails

So when I submit all the info to create a new user: i get this error:

NoMethodError in UsersController#create undefined method `sign_in' for # enter image description here

I googled for it first and found answers where I was supposed to create a sessions_helper.rb file and include it in application.rb , did it all and when I refreshed after each step, it seemed to work. But now when I reloaded the page from the start again, I got the same error again.

Upvotes: 0

Views: 42

Answers (2)

marzapower
marzapower

Reputation: 5611

You need to create a sign_in method in at least the SessionsHelper class.

If you'd like to use the devise gem for users creation/authentication, you'll have that method available in your code directly.

Upvotes: 1

Zippie
Zippie

Reputation: 6088

Veske showed me his code: https://gist.github.com/Veske/7536022

You have to define your method in the SessionHelper, it is not going to automatically be made for you :)

Upvotes: 1

Related Questions