Guest User

Untitled

a guest
May 12th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. I did a code for basic user authentication. in my controller I call this :
  2.  
  3. def self.authenticate(username,password)
  4. user = find(:first,:conditions=> { :username =>username,:password=>password})
  5. return user
  6. end
  7.  
  8. but, it seems there are other ways to do a find:
  9. user = find(:first, :conditions => ['username = ?',username])
Add Comment
Please, Sign In to add comment