Maybe I'm missing something simple but I can't figure out after some time looking at this.

I want to check if a boolean is true in a database on a form, if it is display a up arrow, if not down arrow.

I have this

<% for probe in @probes %>
    <tr id="<%= cycle('list-line-odd', 'list-line-even') %>">
      <td>
        <%= if probe.online = true %>
        <%= image_tag("online-icon.png", :alt => "Online") %>           
        <%= end %>
    </td>
      <td><%= link_to probe.probe_name, probe %></td>
    </tr>
  <% end %>

but it's coming back this this error

compile error

syntax error, unexpected ')', expecting kTHEN or ':' or '\n' or ';'

@output_buffer.concat "\t      \t"; @output_buffer.concat(( if probe.online = true ).to_s);
@output_buffer.concat "\n"

syntax error, unexpected kEND
@output_buffer.concat "      \t \t"; @output_buffer.concat(( end ).to_s);@output_buffer.concat "\n"

with arrows pointing at the .to_s

Edit
Report