This happens because Haml compiles internally to Ruby code - in particular,
it uses #{} to interpolate the dynamic Haml code into a static HTML string.
Usually, Ruby syntax errors will register as actual syntax errors in the
compiled document, but sometimes (as in this case) they'll interact
strangely with the compiled format and result in odd results like this.

This is certainly sub-optimal, but without invoking an actual Ruby parser on
the Haml input there's not really a good way to detect it and raise a better
error.

On Thu, Jan 7, 2010 at 1:53 PM, juan matias <[email protected]> wrote:

> I have some weird output in a view, i have this line in a  template
> view (/_form.html.haml) :
>
> .....
>    = f.submit button_name, :class => 'submit_button', :disable_with
> => t('global.please_wait') }
> ....
>
>  the output render all the view correctly except for this text that
> appear beside the submit button:
>
> _hamlout.format_script_false_false_false_false_false_true_false
> ((haml_very_temp = haml_temp; haml_temp = nil; haml_very_temp));}
>
> the problem is an syntax error, above in the template I add, by
> mistake, an curly brace at the end, if I remove it, all work fine.
>
> I want to know why this happend, maybe is a bug.
>
> I'm using Rails 2.3.4, 2.2.15, and ruby 1.8.7 (2009-06-12 patchlevel
> 174) [i686-darwin10.0.0]
>
> Thanks.
>
> --
> 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] <haml%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.
>
>
>
>
--
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.

Reply via email to