I have a session controller that inherits from Devise :: SessionsController:
class SessionsController < Devise::SessionsController skip_before_filter :authenticate_user!, :only => [:get_token] def create .... end def destroy ... end def get_token response.headers["app-key"] = form_authenticity_token() render :text=>'Token Set' end end
As you can see above, I overwrite the create and destroy action, and I added another action called get_token. I added routes for it as shown below:
routes.rb
Application.routes.draw do devise_for :users, :controllers => { :sessions => "sessions" }, :path => "users", :path_names => { :sign_in => 'login', :sign_out => 'logout',:confirmation => 'verification'} match 'get_token', :to => 'sessions#get_token'
But I get the following errror when I try to access the get_token method;
[Devise] Could not find devise mapping for path "/get_token".
How to add a route for get_token action.
Thanks in advance
ruby-on-rails routing devise
Abhimanyu
source share