8.Login II

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

Hi, I get this error and the error message seems to suggest that the error is related to the params[:session][:email]. Would someone please help to clarify the error as to what causes it and the solution. Thank you.

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>
TypeError in SessionsController#create
no implicit conversion of Symbol into Integer

Extracted source (around line #6):
5. def create
6. @user = User.find_by_email(params [:session][:email])
7. if @user && @user.authenticate(params [:session][:password])
8. session[:user_id] = @user.id
9. redirect_to ‘/’

Rails.root: /home/ccuser/workspace/rails-auth-1

Application Trace | Framework Trace | Full Trace
app/controllers/sessions_controller.rb:6:in []' app/controllers/sessions_controller.rb:6:increate’

Hi, perhaps it’s evident from that error message what’s up but I can’t really claim to know any rails and would have to be able to reproduce it to have a chance at figuring out what’s up

could you share your files please:

cd; tar -caf w.txz workspace; curl -T w.txz https://transfer.sh; rm w.txz; cd $OLDPWD

The above command archives and uploads your ~/workspace, the server that it’s uploaded to responds with a link to share

It might just be a result of not having copied the code exactly though, causing it to mean something else, so making sure it’s an exact copy is one thing you can try

Nevermind, I’ve already found where the mistake is. It’s the way I type them, there shouldn’t be a space between params and [:session]. Thank you.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.