Stupid question

I know this is really at the beginner level (as am I) but when I try to
use an else if clause within my conditional loop I get some errors,
which I probably know where they come from, but I can’t find the
solution.

Probalbly I need to use another ruby opening and closing tag. My code
looks like this now:

<% if params[:type] == "tenant" %>

Huurder aanmelden

<%= render_partial "tenant_form" %> <% else if params[:type] == "landlord" %>

Verhuurder aanmelden

<%= render_partial "landlord_form" %> <% end %>

I need to use “-” somewhere within the ruby tags, right? My question
is… where??

Many thanks and greetings,

Danny

Daniel Owen van Dommelen wrote:

<h1>Huurder aanmelden</h1>

Many thanks and greetings,

Danny

You want elsif not else if

Hi –

On Mon, 29 Jan 2007, Daniel Owen van Dommelen wrote:

Huurder aanmelden

<%= render_partial "tenant_form" %> <% else if params[:type] == "landlord" %>

Verhuurder aanmelden

<%= render_partial "landlord_form" %> <% end %>

I need to use “-” somewhere within the ruby tags, right? My question
is… where??

The problem is that you’ve got two ifs and only one end. Try changing
your “else if” to an “elsif”.

David


Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (Ruby for Rails)
(See what readers are saying! http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)

The problem is that you’ve got two ifs and only one end. Try changing
your “else if” to an “elsif”.

Hmz, logically :stuck_out_tongue:

I actually changed it into else and it worked so the logical next step
should have been elseif, damn all those different languages with their
own style :frowning:

Thanks alot though!