Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise: Sign Up Page as Welcome/Landing Page then to User Profile

Using devise, how do i make my Sign Up as my landing/welcome page and then after sign up they go inside the site to the Profile/signed in area?

I am trying to figure out how to make it like where Facebook their is two sides of the website; the Outside (sign up, about,contact,etc) and The Inside (Profile,sign out,etc) for Users only after sign up or sign in.

Thank you.

P.S. I am new at Ruby on Rails and creating applications but i did do the authentication system with the Rails 3 Tutorial, i understand most things to start using Devise, i jst dont know where to start with this situation.

I was going to use 2 application layouts, 1 before sign up which is layouts/welcome.html.erb with PagesController (about,terms,etc) and the other for signed in users which will be layouts/application.html.erb with ApplicationController (profile,news,add,etc), is this the best steps?

like image 572
LearningRoR Avatar asked Apr 28 '11 21:04

LearningRoR


1 Answers

in your routes.rb:

root :to => 'welcome#index'

Where welcome is the controller and index is the action.

In your application controller:

def after_sign_in_path_for(user)
   "/url_you_want_to_redirect_to/"
end
like image 184
Jasdeep Singh Avatar answered Oct 04 '22 22:10

Jasdeep Singh