Hi Nic,
I've come up with a solution for my case. See
https://gist.github.com/1255275#gistcomment-344355
.
In short, the Api namespace I use is 100% custom, just thought adding
devise to it (just like the default), would save me time. The routes
didn't, but I do use the Devise helpers to authenticate using token.
If you'd like more info, just shoot me a message.
Regards,
Dennis
> >> MySite::Application.routes.**draw do
> >> namespace :api do
> >> namespace :v1 do
> >> devise_for :users,:controllers => { :sessions => "api/v1/
> >> user_sessions",:registrations=**>"users" }
> >> ......
> >> end
> >> end
> >> devise_for :users,:controllers => { :sessions =>
> >> "user_sessions",:**registrations=>"users" } do
> >> post 'users/sign_in' => 'user_sessions#create', :as
> >> => :user_session
> >> get 'users/sign_in' => 'user_sessions#new', :as
> >> => :new_user_session
> >> get 'users/sign_up' => 'user_sessions#new', :as
> >> => :new_user_session
> >> match 'users/sign_out' => 'user_sessions#destroy', :as
> >> => :destroy_user_session
> >> <.....>
> >> end
> >> ----- DEFAULT NAMESPACE USER_SESSIONS_CONTROLLER -----
> >> class UserSessionsController < Devise::SessionsController
> >> ....
> >> end
> >> ---- API NAMESPACE USER_SESSIONS_CONTROLLER ---- (this goes to my
> >> custom Devise base controller marked below)
> >> class Api::V1::**UserSessionsController < Api::V1::DeviseBaseController