Skip to content

Instantly share code, notes, and snippets.

@scottmessinger
Created July 13, 2011 16:39
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 scottmessinger/1080709 to your computer and use it in GitHub Desktop.
Save scottmessinger/1080709 to your computer and use it in GitHub Desktop.
Devise in namespaces
class Api::V1::CoursesController < ApplicationController
def create
current_user ## is nil even though there's a user logged in. How do I access current_user?
end
end
namespace "api" do
namespace "v1" do
resources :users
resources :courses do
resources :units
end
resources :contents
resources :units do
resources :units
end
end
end
devise_for :users do
get 'users/sign_out' => 'devise/sessions#destroy'
post 'users' => 'devise/registrations#create'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment