You could use the devise helper methods like

 after_update_path_for
after_sign_in_path

I am not sure if this is the method's name, please check the documentation
for better understating.


thanks

follow this link
https://github.com/plataformatec/devise/wiki/How-To:-Change-the-redirect-path-after-destroying-a-session-i.e.-signing-out

2011/12/23 Gautam Pai <[email protected]>

> Then do
>
> root :to => welcome#index
>
> move authenticate_user! from ApplicationController to ProjectsController
>
> then when user is logged in and visits welcome#index he will be redirected
> to projects_url.
>
> If user is not logged in and visits projects url hel will be redirected to
> login page.
>
> Gautam Pai
>
>
> On Fri, Dec 23, 2011 at 5:28 PM, wei jack <[email protected]> wrote:
>
>> Follow Tim solution, Now I did.
>>
>> root :to => welcome#index
>>
>> class ApplicationController < ActionController::Base
>>    before_filter :authenticate_user!, :except[:index, :show]
>> end
>>
>> In my welcome controller index
>>  def index
>>      if user_signed_in?
>>        redirect_to projects_url
>>      end
>>   end
>>
>>
>> I would like to do like colin explained.
>>
>>  root :to => project#index
>>
>> but how to show the welcome#index as root if user not signed in ?
>>
>>
>> Gautam Pai,Thank for reply. :)
>> Using ur explaination.. when user not signed in.
>> localhost:3000 it will go to login page.
>>
>> I want it go welcome#index before user choose to login.
>> Correct me, if I misunderstand ur explanation.
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>



-- 
thiagocifani
http://thiagocifani.wordpress.com/
twitter.com/thiagocifani
del.icio.us/thiagocifani
<http://del.icio.us/thiagocifani>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to