Partials - asked before never got reply

I’m trying to figure out how multiple partials in one page would be
configured when they are based on some action in the controller.
As an example -
I have a main/welcome page. If someone new or a user not logged in
arrives at this page I display both a registration form and a login
form. However, if they are logged in then those forms should not show
up on that page. Also should mention that I have a _register partial
and a _login partial.

Now maybe I just need a seperate page to welcome users who are logged
in but I want to see if I could do it as described above.
Right now the welcome.rhtml page is set up like such:

<% if @u %> #if user is logged in / session
<%= render :partial => “main/logout” %>
<%= render :partial => “main/session” %>
<%= @c.first_name %>
<% else %>
<%= render :partial => “main/login” %>
<%= render :partial => “main/register” %>
<% end %>

And in the layout:

<%= render(:partial => "logout" )%> <%= render(:partial => "register" ) %>
<%= render(:partial => "login" ) %>

So I think this is all wrong but not sure how to go about
accomplishing my design.
Any help / suggestions would be greatly appreciated.

TIA
Stuart

So what exactly is your problem? I can’t quite work that out from the
post. What are you trying to achieve and why is what you are doing
currently not working?

Max

Hi –

On Thu, 10 Aug 2006, Dark A. wrote:

in but I want to see if I could do it as described above.

accomplishing my design.
Any help / suggestions would be greatly appreciated.

Don’t put things in the layout unless you want them displayed :slight_smile:

David


http://www.rubypowerandlight.com => Ruby/Rails training & consultancy
----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <-----
http://dablog.rubypal.com => D[avid ]A[. ]B[lack’s][ Web]log
Ruby for Rails => book, Ruby for Rails
http://www.rubycentral.org => Ruby Central, Inc.

none

Ok, I realized that was my problem but I still need to use
@content_for_layout though

Stuart

Is my question just ridiculous , too basic or no one actually knows ?

Stuart

In your layout just surround the 2 divs with the if statement just like
you
did in welcomr.rhtml