Created
November 4, 2014 14:04
-
-
Save mankind/2dc4b6956c301f601508 to your computer and use it in GitHub Desktop.
namespaceing devise_for user but not current_user helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :api do | |
#when devise_for is called in a namespace, the helpers and controller filters change | |
#:singular => :user added so we can use current_user instead of current_api_user. | |
#And before_filter authenticate_user! instead of authenticate_api_user! | |
#https://github.com/plataformatec/devise/issues/412 | |
#devise_for :users, :singular => :user, skip: :all | |
get :csrf, to: 'csrf#index' | |
resources :users | |
resources :sessions | |
#post "/sign_in" => "sessions#create" | |
delete "/signout" => "sessions#destroy" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment