search for: redirect_to_root

Displaying 1 result from an estimated 1 matches for "redirect_to_root".

2010 Dec 21
5
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
...#39;' %> <% end %> <% end %> Because I didn''t declare @user in login method: def login if request.post? if session[:user] = User.authenticate(params[:user][:login], params[:user][:password]) flash[:message] = "Login successful" redirect_to_root else flash[:warning] = "Login unsuccessful" end end end There is no @user and so interpreter throws the exception. However, what can I do in order to allow someone the opportunity to signin when using a form? Do I create a temporary blank user: @user = User.new...