Thursday, June 3, 2010

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

It seems that inside of HAML's :javascript filter, no Ruby code is
allowed, not even a comment.

So this is NOT allowed:

:javascript
- 1.upto(10) do |i|

:javascript
-# just a comment not to show to public

(somebody said there is not way to hide comment like that inside a
:javascript filter. Is that true?

but it seems the only thing allowed is

:javascript
$('#aDiv').html('#{a_ruby_variable}';

only this #{ } is allowed. Nothing else that is Ruby is allowed?
--
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