Conditional statements in rhtml

Hello i was wondering is there was any way of using an IF statement in a .rhtml..?

So far i have this: <div class='bar2' id='barpo6'><strong>State: </strong><%= if @boards.running == "1" render :text => "Running" %></div>

<...>

<%= @boards.running==1?'Running':'Waiting' %>

Regards, Rimantas

Ro Vent wrote:

    <div class='bar2' id='barpo6'><strong>State: </strong>         <% if @boards.running == "1" %>             <%= render :text => "Running" %>         <% else %>             <%= render :text => "Waiting" %>         <% end %>     </div>

The excess %><% freak me out.

         <%= render :text => if @boards.running == "1"              "Running"          else              "Waiting"          end %>

Idiomatic but legible!

=> false

Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com

>> 1=="1" => false

That's one thing. Second: you shouldn't use render :text in .rhtml templates. I does not work there (AFAIK).

Regards, Rimantas