Distinct landing and home pages.

20 views
Skip to first unread message

paulj...@gmail.com

unread,
Jun 1, 2012, 4:28:24 PM6/1/12
to hobo...@googlegroups.com
I would like visitors to my app to see a landing page with a link to a login page, and logged-in users to have a separate home page, showing information about their accounts, etc.

I would like them to be two distinct pages, rather than have conditional content, because they will have different layouts, backgrounds, etc.

What is the best way to do that?

Thanks for any advice.

Paul

Matt Jones

unread,
Jun 1, 2012, 4:34:56 PM6/1/12
to hobo...@googlegroups.com
Quickest way would probably be to either change what's being rendered in FrontController#index:

def index
if current_user
render :template => 'some other page', :layout => 'the layout for that'
end
end

or to redirect logged-in users (or not-logged-in) to a different action.

--Matt Jones

paulj...@gmail.com

unread,
Jun 1, 2012, 6:37:32 PM6/1/12
to hobo...@googlegroups.com
That sounds great, thanks.
Reply all
Reply to author
Forward
0 new messages