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: <div id="aanmelden"> <% if params[:type] == "tenant" %> <h1>Huurder aanmelden</h1> <%= render_partial "tenant_form" %> <% else if params[:type] == "landlord" %> <h1>Verhuurder aanmelden</h1> <%= render_partial "landlord_form" %> <% end %> </div> I need to use "-" somewhere within the ruby tags, right? My question is... where?? Many thanks and greetings, Danny -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Daniel Owen van Dommelen wrote:> 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: > > <div id="aanmelden"> > <% if params[:type] == "tenant" %> > <h1>Huurder aanmelden</h1> > <%= render_partial "tenant_form" %> > <% else if params[:type] == "landlord" %> > <h1>Verhuurder aanmelden</h1> > <%= render_partial "landlord_form" %> > <% end %> > </div> > > I need to use "-" somewhere within the ruby tags, right? My question > is... where?? > > Many thanks and greetings, > > Danny > >You want elsif not else if --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi -- On Mon, 29 Jan 2007, Daniel Owen van Dommelen wrote:> 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: > > <div id="aanmelden"> > <% if params[:type] == "tenant" %> > <h1>Huurder aanmelden</h1> > <%= render_partial "tenant_form" %> > <% else if params[:type] == "landlord" %> > <h1>Verhuurder aanmelden</h1> > <%= render_partial "landlord_form" %> > <% end %> > </div> > > 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 (http://www.manning.com/black) (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) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> The problem is that you''ve got two ifs and only one end. Try changing > your "else if" to an "elsif". > >Hmz, logically :p 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 :( Thanks alot though! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---