So which is it? What do I have to do to get around this? My
indentation is perfect, so I don't see what else I can do.
Incidentally this appears to be a new problem with the latest version
of haml. Before I was using "- end" and it worked perfectly.
I realize this isn't a direct answer to your question but to give you
some context I have been using haml since it was first released and I
have used in on many many projects. I absolutely cannot go back to rhtml
because haml is so much more concise. Still though, I have no idea the
answer to your question. Why? Because I had always heard that
conditional logic should not be in my views. I realize this is a
personal opinion but I figure I would show you how I would handle this:
# application_helper.rb
# even if flash error doesn't exist this will return nil (empty as
expected)
def place_flash_message
flash[:notice] ? flash[:notice] : flash[:error]
end
# view.html.haml
= place_flash_message
or if I really need conditional logic such as in:
if logged_in?
something
else
other thing
I would simply create a helper or a helper block with capture.
Anyways, in my opinion this improves readability and as a general rule
of thumb in 2 years of rails development projects I have never felt the
need to stick conditional logic directly in my view.
Now assuming you discard all that, I think the correct method is not to
put the end in haml which would make more sense in the haml way of doing
things. Since I haven't actually needed to do this, I am not sure the
issue. Good luck