ternary operator

Hi    In my rhtml file I have tried   <td class="pageDATAFIELD">        <% @problem.reproducible ? "Yes" : "No" %>    </td>        reproducible is a boolean field.The above not working And i checked <% @problem.reproducible ? puts("Yes") : puts("No") %> Now I get required result on console So how to print it on screen

Thanks in advance Sijo

start it with

<%=

to indicate it will be output in the view.

Beginner’s mistake:

<%= @problem.reproducible ? “Yes” : “No” %>

To show something on your page, you need the “=”

Best regards

Peter De Berdt

Hi   In my rhtml file I have tried <td class="pageDATAFIELD">       <% @problem.reproducible ? "Yes" : "No" %>   </td>       reproducible is a boolean field.The above not working And i checked <% @problem.reproducible ? puts("Yes") : puts("No") %> Now I get required result on console So how to print it on screen

You need to use <%= instead of <% if you want the result to be
inserted in the page.

Fred

O sorry     Thanks