You are right, that was backwards. After a bit of refactoring, I came
up with
devise_for :users
devise_scope :user do
root :to => "users#current"
get '/users/current' => "users#current", :as => :current_user
resources :users, :only => [:index, :show]
end
to do what I was looking for.
I could not use
devise_for :users do
root :to => "users#current"
get '/users/current' => "users#current", :as => :current_user
resources :users, :only => [:index, :show]
end
due to route ordering. '/users/:id(.:format)' would be before '/users/
sign_in(.:format)', for example.
There are still aspects that I don't understand. In particular, if I
use
devise_scope :users do ...
instead of
devise_scope :user do ...
I get the error
Started GET "/" for 127.0.0.1 at 2010-09-27 10:08:42 -0700
Processing by UsersController#current as HTML
Completed in 0ms
AbstractController::ActionNotFound
(AbstractController::ActionNotFound):
even though routes look exactly the same.
Any further insight would certainly be welcome. Thanks in advance.
On Sep 22, 5:49 am, Carlos Antonio da Silva
<
carlosantoniodasi...@gmail.com> wrote:
> I'm not sure pointing "/" to Devise session would be the best, cause every
> time a user access "/", if he's signed in, it's going to have a redirect.
>
> Take a look on the wiki here to have some more info:
http://github.com/plataformatec/devise/wiki/How-To:-Change-the-defaul...