Here's my problem: I'm using haml templates. Haml has a nice tag for
embedding javascript. So I can have a template that look like so:
%h1 my page
#someDiv
:javascript
window.addEvent('domready', function(){
// do some cool stuff
});
This allows me quite a bit of freedom. However, what do I do when the
javascript needs some parameters, for example some variable from my
controller? I can't do this as the haml javascript embedding is
literal.
I have been thinking about a merb helper so I could write the above
as:
%h1 my page
#someDiv
= javascriptHelper
window.addEvent('domready', function(){
// do some cool stuff WITH PARAM PARSING ON THIS CONTENT
});
But I don't see how this can be done. Any ideas on how to make this
easy? The current helpers I'm writing are horrific javascript string
concatenation nightmares.
thanks, Jon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---