We Recommend

The Rails Way The Rails Way
Now, for the first time, there’s a comprehensive, authoritative guide to building production-quality software with Rails. Pioneering Rails developer Obie Fernandez and a team of experts illuminate the entire Rails API, along with the Ruby idioms, design approaches, libraries, and plug-ins that make Rails so valuable.


Posted By

winson on 04/30/07


Tagged

login textmate controller


Versions (?)


Basic login


Published in: Rails 


  1. def login
  2. if request.post?
  3. begin
  4. session[:user] = User.authenticate(params[:employee][:email], params[:employee][:password]).id
  5. redirect_to :controller => 'tickets', :action => 'list_open'
  6. rescue AuthenticationError => e
  7. flash[:warning] = "#{e}"
  8. end
  9. end
  10. end

Report this snippet 

You need to login to post a comment.