Walter Davis wrote in post #1129271:
> On Dec 2, 2013, at 5:16 PM, yinwen Xuan wrote:
>
>>>> because the the field display not right, when its sqm, it show M2 I want
>>>
>> the original code on the themes is:
>> and thanks in advance!
> If you're trying to do a comparison, you need to quote the M2, since it
> will be a string value, not a constant. Also, if you're doing a
> comparison (which you don't want to output any value) then don't use <%=
> %> as the container, rather <% %> or <%- %> so as to avoid outputting
> the result of land_area_unit == 'M2', which would be 'true' some of the
> time.
>
> Walter

I tried this:

Land Area: <%= land_area  %> <%= if land_area_unit == M2  %> m&sup2; <% 
else %> <% end %>

but not working

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/f357ff60cfa96f4849285867f74dac7e%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to