Devise login mobile api in ruby on rails
In routes.rb namespace :api do namespace :v1 do devise_scope :user do post "/sign_in" , :to => 'session#create' delete "/sign_out" , :to => 'session#destroy' end end In Api::V1::SessionsController:- class Api::V1::SessionsController < Api::V1::ApiController before_filter :authenticate_user!, :except => [:create] skip_before_filter :verify_authenticity_token respond_to :json def create email = params[:email] password = params[:password] if request.format != :json render :status=>406, :json=>{:message=>"The request must be json"} return ...