Skip to content

Instantly share code, notes, and snippets.

@abhishek0
Last active December 20, 2015 21:19
Show Gist options
  • Save abhishek0/6196790 to your computer and use it in GitHub Desktop.
Save abhishek0/6196790 to your computer and use it in GitHub Desktop.
class LoginController < ApplicationController
skip_before_filter :check_authentication, :only => :index
def index
respond_with User.where(login_params)
end
private
def login_params
params.permit(:email, :password)
end
end
Started POST "/login" for 127.0.0.1 at 2013-08-10 01:35:01 +0530
Processing by LoginController#index as */*
Parameters: {"{\"email\": \"admin@example.com\", \"password\": \"admin\"}"=>"[FILTERED]"}
Unpermitted parameters: {"email": "admin@example.com", "password": "admin"}
Completed 404 Not Found in 66ms
ActiveRecord::RecordNotFound (Couldn't find User without an ID):
app/controllers/login_controller.rb:5:in `index'
Rendered /home/abhishek/.rvm/gems/jruby-1.7.4/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_source.erb (5.0ms)
Rendered /home/abhishek/.rvm/gems/jruby-1.7.4/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (5.0ms)
Rendered /home/abhishek/.rvm/gems/jruby-1.7.4/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (4.0ms)
Rendered /home/abhishek/.rvm/gems/jruby-1.7.4/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (36.0ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment