eightonrose
eightonrose

Reputation: 688

Rails 4.0 User Authentication/Signup

I'm currently doing this tutorial:

http://net.tutsplus.com/tutorials/building-ribbit-in-rails/

but tried to update it to 4.0 myself since it seems a bit outdated.

https://github.com/erosenberg/myribbit

One of the things that stands out to me is that the tutorial was using 'attr_accessible' whereas I was using a private method to define the params for users to signup.

The solution doesn't have to match the tutorial (I only just got to the part with Sessions) but I would love to be able to see how to fix this specific error that isn't making sense to me and constantly sending me down a rabbit hole:

ArgumentError in Users#new. wrong number of arguments (1 for 0). app/controllers/application_controller.rb:7:in `current_user'

Any help is greatly appreciated. Thanks!

EDIT: Here is a screenshot of my error in case nobody else is seeing it: enter image description here

Upvotes: 0

Views: 240

Answers (1)

Agis
Agis

Reputation: 33626

You have a typo in your code: https://github.com/erosenberg/myribbit/blob/master/app/controllers/application_controller.rb#L7

session [:user_id] should be session[:user_id].

Upvotes: 1

Related Questions