Re: [Rails] ruby script if statement

2013-12-03 Thread Scott Ribe
On Dec 3, 2013, at 6:08 PM, yinwen Xuan wrote: > Sorry Scott, All fixed now. > you are a good teacher!! > let me know if you want student, I am happy to pay tuition ;-) I'm glad it's working. One last thing, regarding people who told you to move this from view to controller, and your response

Re: [Rails] ruby script if statement

2013-12-02 Thread Scott Ribe
On Dec 2, 2013, at 8:43 PM, yinwen Xuan wrote: > but the result is all showing sq feet, any idea, sorry I don't know > where else I can work it out. You're very close, but spelling matters. Review my prior message to you. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/

Re: [Rails] ruby script if statement

2013-12-02 Thread Scott Ribe
On Dec 2, 2013, at 8:03 PM, yinwen Xuan wrote: > Then I extend your code to the follow, but not working :-( How many "if"s? How many "end"s? See the problem? Seriously, you need to work through a tutorial, as suggested earlier, rather than expect the members of this forum to write your code on

Re: [Rails] ruby script if statement

2013-12-02 Thread Walter Lee Davis
On Dec 2, 2013, at 8:33 PM, yinwen Xuan wrote: > 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

Re: [Rails] ruby script if statement

2013-12-02 Thread Walter Lee Davis
On Dec 2, 2013, at 5:16 PM, yinwen Xuan wrote: > Colin Law wrote in post #1129260: >> On 2 December 2013 21:22, yinwen Xuan 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

Re: [Rails] ruby script if statement

2013-12-02 Thread Colin Law
On 2 December 2013 20:24, yinwen Xuan wrote: > Can anyone have a look this ruby script why it's not working: > > <%= if land_area_unit == M2 %>m² <% else %> <%= if land_area_unit > == HA %>Ha <% else %><%= if land_area_unit == AC %>Ac<% else %>f² It may be better to do it in the controller anywa

[Rails] ruby script if statement

2013-12-02 Thread yinwen Xuan
Can anyone have a look this ruby script why it's not working: <%= if land_area_unit == M2 %>m² <% else %> <%= if land_area_unit == HA %>Ha <% else %><%= if land_area_unit == AC %>Ac<% else %>f² What I want to do is show the right unit for the land area. Thanks! -- Posted via http://www.ruby-f