On 2 December 2013 21:22, yinwen Xuan <li...@ruby-forum.com> wrote: > could you just check why the ruby script not work
Why should I help when you have not followed my request not to top post and to remember to quote the previous reply? > > it work when only use the field name : <%= land_area_unit -%> > > because the the field display not right, when its sqm, it show M2 I want > it show m², that's why I want to write a if statement to showing the > right unit format: > > <%= if land_area_unit == M2 %>m² <% else %> <%= if land_area_unit > == HA %>Ha <% else %><%= if land_area_unit == AC %>Ac<% else %>f² There are so many things wrong I don't know where to start. Have a look at http://www.howtogeek.com/howto/programming/ruby/ruby-if-else-if-command-syntax/. What is ² intended to be? Should it be ² perhaps. What are the variables M2 and H2 set to? Colin -- 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/CAL%3D0gLsxvx2D820Pim8C-MgvaERoZ6POieiWbnWR%3DyAYJv-NQA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.