Answer the question
In order to leave comments, you need to log in
How to deal with Ruby syntax?
I use Sublime Text 3 and almost always, when writing, when something like this message pops up
Inconsistent indentation: 11 spaces used for indentation, but the rest of the document was indented using 4 spaces.
%body
%header
.wrapper.clearfix
#logo= link_to "Muse", root_path
%nav
- if user_signed_in?
= link_to current_user.name, edit_user_registration_path
= link_to "Add New Inspiration", new_post_path, class: "button"
- else
= link_to "Sign In", new_user_session_path
= link_to "Sign Up", new_user_registration_path, class: "button"
%p.notice= notice
%p.alert= alert
Answer the question
In order to leave comments, you need to log in
This is not Ruby syntax. This is HAML
syntax .
To understand it, you need to understand HTML
. If you constantly have an odd number of spaces, then you either put them manually (not tabs) or copy them from different sources.
Actually, it's a matter of habit. If inconvenient, use regular ERB. With the help of e.g. - https://github.com/haml/html2haml - one can translate all HAML to ERB
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question