Haml 1.5, the current version, introduced a lot of error checking where
there previously was none. In Haml 1.0, invalid Haml code would be
parsed under the assumption that it was valid, leading to unpredictable
results; in 1.5, it will throw an error message instead.
Your error message in particular comes from increasing the tabulation in
a situation where you shouldn't. For instance, it'll be thrown if you do
something like
%p foo
bar
because the p tag has already been assigned content ("foo"), so
assigning it content again ("bar") doesn't make sense.
In your particular case, the issue is in _quick_email.haml:
= start_form_tag({:action => 'change_email'})
%span First Name
You're already assigning content to that =, so it doesn't make sense to
nest content within it. It would make sense, though, if you were using a
Ruby block, like so:
= start_form_tag({:action => 'change_email'}) do
%span First Name
Which I think is what you were going for.
Hope that's helpful!
- Nathan
yingji wrote:
> I'm getting a lot of errors like this after upgrading to the current
> stable build from a build in 2006.
>
> My code worked OK last year after I converted all rhtml to haml.
>
> What exactly does that error message mean?
>
> I have code like this
>
> #list.haml
>
> - content_for('tasks') do
> = task_quick('email', 'Change Email')
> = render :partial => 'quick_email'
>
> #_quick_email.haml
>
> #email.quick{:style => 'display:none;position:absolute;'}
> = start_form_tag({:action => 'change_email'})
> %span First Name
> = text_field 'current_user', 'first_name'
> %span Last Name
> = text_field 'current_user', 'last_name'
> %span Email
> = text_field 'current_user', 'email'
> = go('Save')
> = close('email')
> = draggable_element 'email'
>
> Thanks for any help!
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---