Skip to content

Instantly share code, notes, and snippets.

@mankind
Created November 4, 2014 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mankind/2dc4b6956c301f601508 to your computer and use it in GitHub Desktop.
Save mankind/2dc4b6956c301f601508 to your computer and use it in GitHub Desktop.
namespaceing devise_for user but not current_user helper
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