Saturday, June 5, 2010

[Rails] Re: What kind of Ruby / Erb is allowed inside HAML's :javasc

Marnen Laibow-Koser wrote:
>
> If you think you need Ruby in your JS, you've got a design problem. Fix
> it.

i can think of a few cases where Ruby might be wanted inside of
Javascript output:

1) -# to add comment but not to show it to the public
2) using if else to output something based on some condition
3) using loop
4) providing values to javascript code by json


--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate