Ruby on Rails Monday, December 2, 2013

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

hi Walter, Thanks for your advcie, so what should I change it to, I
just want to display m² instead of M2.
cheers

--
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+unsubscribe@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/fabc45ef5f383bac36187381fcf4529b%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment