### How do I make my long lines of Ruby code look nicer in my Haml document?
{#q-multiline}
Put them in a helper or your model.
Haml purposefully makes it annoying to put lots of Ruby code into your templates,
because lots of code doesn't belong in the view.
If you take that huge `link_to_remote` call
and move it to a `update_sidebar_link` helper,
it'll make your view both easier to read and more semantic.
If you absolutely must put lots of code in your template,
Haml offers a somewhat awkward multiline-continuation tool.
Put a `|` (pipe character) at the end of each line you want to be merged into one
(including the last line!).
For example:
%p= @this.is(way.too.much). |
code("and I should"). |
really_move.it.into( |
:a => @helper) |
### I have Haml installed. Why is Rails (only looking for `.html.erb` files | rendering Haml files as plain text | rendering Haml files as blank pages)?
{#q-blank-page}
There are several reasons these things might be happening.
First of all, make sure `vendor/plugins/haml` really exists
and has an `init.rb` file in there.
Then try restarting Mongrel or WEBrick or whatever you might be using.
Finally, if none of these work,
chances are you've got some localization plugin like Globalize installed.
Such plugins often don't play nicely with Haml.
Luckily, there's usually an easy fix.
For Globalize, just edit `globalize/lib/globalize/rails/action_view.rb`