ruby on rails - How to set the signup page as homepage -


i've installed devise in ror app. want root site ( http://site.com ) displays devise sign page.

if user logged, redirect user dashboard. but, if user go http://site.com/dashboard , not logged, redirect home page, user can see sign up.

how can this?

thank you

update:

in routes.rb there is

root :to => 'users#index'  

and in users_controller:

def index     if user_signed_in?       render 'dashboard'     else       redirect_to new_user_registration_path     end   end 

it's correct?

add following routes.rb

   authenticate :user       root :to => "user_dashboard#show"     end     root :to => "devise/sessions#new" 

change "user_dashboard#show" controller#method dashboard.

authenticate devise specific method routes file.

source: http://rdoc.info/github/plataformatec/devise/master/actiondispatch/routing/mapper#authenticate-instance_method


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -