Created
August 9, 2013 20:27
-
-
Save abhishek0/6196898 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginController < ApplicationController | |
skip_before_filter :check_authentication, :only => :index | |
def index | |
user = User.find_by_email(params[:email]) | |
if user and user.authenticate(params[:password]) | |
respond_with user | |
end | |
end | |
private | |
def login_params | |
params.require(:login).permit(:email, :password) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment