I have a jQuery script that adds a new field to a form, and this field contains dynamic information from an array. The problem is that I can\'t figure out how to add an arra
Try this, it should work (all i did was remove a single space in the fifth line and add the closing quote on the sixth):
%script(type="text/javascript")
$('#mylink').click(function() {
$('#mylink').after('');
)};
However, assuming you're running this with a ruby script or framework of sorts, why not just do it outside the template? That would probably be most appropriate. In rails/sinatra and other frameworks, you could use a helper method to do this. If you look at the haml reference, they actually discourage use of - to evaluate ruby.