Skip to content

Instantly share code, notes, and snippets.

@abhishek0
Created August 9, 2013 20:27
Show Gist options
  • Save abhishek0/6196898 to your computer and use it in GitHub Desktop.
Save abhishek0/6196898 to your computer and use it in GitHub Desktop.
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