Filters are there to make it easier to embed other languages (like
Javascript) in a Haml document. You're trying to have the :javascript
filter contain Haml code, which doesn't make sense. What you really want
is to use a helper. Rails supplies the javascript_tag helper:
- javascript_tag do
- ['Andy', 'James'].each do |name|
root.add_child('#{name}');
soliiid wrote:
> For example, I want to generate javascript
>
> <script type='text/javascript'>
> root.add_child('Andy');
> root.add_child('James');
> </script>
>
>
> but haml
>
> :javascript
> - ['Andy', 'James'].each do |name|
> root.add_child('#{name}');
>
> does not work..
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---