title: API signin to generate token using devise in rails 4
body: <p>I am implementing api via rails.</p>
  
  <p>I want to implement following feature but unable to figure out how?</p>
  
  <p>I tried this sample app</p>
  
  <p>I have user model with email, password and access_token</p>
  
  <pre><code>class UsersController &lt; ApplicationController
  
     def signin
  
  
          c_user = User.find_by_email(params[:email])
          pass = params[:password]
          if c_user.password == pass
  
            render json: c_user.access_token
          end  
  
     end
  
  
     private  
      def users_params    
          params.require(:user).permit(:email, :password) 
      end
  
  end
  </code></pre>
  
  <p>If user request via api for <a href="http://localhost:3000/signin?email=t1@t.com&amp;password=password" rel="nofollow">http://localhost:3000/signin?email=t1@t.com&amp;password=password</a></p>
  
  <p>then it will check email and password and return access_token that user can use for future request.</p>
  
  <p>I want to implement same with devise or any other gem please help me to understand it. 
  Thanks in advance </p>