class SessionsController < ApplicationController
def new
end
def create
user = User.authenticated(params[:email], params[:password)
if user
session[:user_id] = user_id
flash[:notice] = "Log In Complete"
redirect_to root_url
else
flash.now.alert = "Invalid Email or Password"
render 'create'
end
end
def destroy
session[:user_id] = nil
redirect-to root_url, :notice =>"Logged Out"
end
end
을하지만이 오류 얻을 :
이I:/dev/abierto/app/controllers/sessions_controller.rb:5: syntax error, unexpected ')', expecting ']'
I:/dev/abierto/app/controllers/sessions_controller.rb:19: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '(' redirect-to root_url, :notice =>"Logged Out"
I:/dev/abierto/app/controllers/sessions_controller.rb:19: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.' redirect-to root_url, :notice =>"Logged Out"
I:/dev/abierto/app/controllers/sessions_controller.rb:22: syntax error, unexpected keyword_end, expecting $end
아무도 나를 도와 나를 내가 무엇을 말할 수를 잘못하고있는거야?
오류 로그를 읽었습니까? 당신은 그것을 이해하려고 노력했고 당신이 잘못되었다고 말하는 것을 바꾸 었습니까? >> 사용자'params'가 문장의 마지막을 놓치고 있습니다 ... 단지 ** 오류 메시지를 읽으십시오 ** – JMax
'params [: password]'를보세요 – Nick