I am very new in ruby, in rails and in haml. I was recoding a little site I have, and I was trying to create a link in wich is nested a few elements.
The structure I want to be outputted is this one:
<a href="somewhere">
<span>
<img src="/imgs/hello.png" />
</span>
<strong>6
<em>Oct</em>
</strong>
<h1>Title</h1>
</a>
So I was trying it doing this (obviously its real indentation is one tab more than the parent element):
= link_to("somewhere") do
%span
%img(src="/imgs/hello.png")
%strong 6
%em Oct
%h1 Title
end
Wich for me seems to be logic. But it does not. It gives me this error:
Inconsistent indentation: ” \t\t\t\t\t” was used for indentation, but the rest of the document was indented using 1 tab.
The error line number it’s the first line after link_to; the %span element. So, I thought it was because I was not using link_to in a correct way, but seeing that the error talks about indentation problems and after trying it in many different ways, I cannot get it into run.
This should work.
Also, make sure in your editor you’re using spaces as tabs. This will get rid of any funky business.