Reputation: 521
Very quick question concerning HAML. I'm trying to get a pipe "|" to show on my page but HAML seems to be ignoring it...
In .erb I would have written something like this:
<h3>Account |
<%= link_to "Log in", new_user_session_path, class: "nav" %></h3>
<% end %>
In order to show:
Account | Log in
But in HAML it's just ignoring it and showing:
Account Log in
This is the HAML code I'm trying:
%h3
Account |
= link_to "Log in", new_user_session_path, class: "nav"
Does anyone know what I'm doing wrong?
Upvotes: 1
Views: 155
Reputation: 593
The "|" (pipe) character in HAML is used to merge lines in your code into one single line. You can try to escape the pipe character by using |
.
In the end your code should look like this:
%h3
Account |
= link_to "Log in", new_user_session_path, class: "nav"
Upvotes: 1
Reputation: 2575
Try this
%h3
Account
|
= link_to "Log in", new_user_session_path, class: "nav"
Upvotes: 0
Reputation: 2998
You should be able to do like this:
%h3
Account
|
= link_to "Log in", new_user_session_path, class: "nav"
Or replace space by its HTML code:
%h3
Account |
= link_to "Log in", new_user_session_path, class: "nav"
Upvotes: 0