Created
July 13, 2011 16:39
-
-
Save scottmessinger/1080709 to your computer and use it in GitHub Desktop.
Devise in namespaces
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
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 |
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 | |
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