For output. This time
I've posted, but why is it sticking out? There is no problem with indentation
top_page>index.html.haml
.top
%ul.top__side
Genre
%li.top__side__love
love
%li.top__side__work
jobs
%li.top__side__money
money
%li.top__side__friend
friend
%li.top__side__school
school
%li.top__side__other
Other
.top__consultation
.top__consultation__title
List of worries
.top__consultation__text
- @toppages.each do |top_page|
= top_page.contents
.top__consultation__text__time
= top_page.created_at
After a lot of trial and error, it turned out that after each statement did not fit within the originally defined class. What is this? ??
That's why I added the each statement at the very beginning.
top_page>index.html.haml
- @toppages.each do |top_page|
.top
%ul.top__side
Genre
%li.top__side__love
love
%li.top__side__work
jobs
%li.top__side__money
money
%li.top__side__friend
friend
%li.top__side__school
school
%li.top__side__other
Other
.top__consultation
.top__consultation__title
List of worries
.top__consultation__text
= top_page.contents
.top__consultation__text__time
= top_page.created_at
I'm omitting it, but if you combine the indent with the first "top", a Syntax Error I got an error, so I want to be careful. All need to be indented one by one (obviously)
That is the solution. I understand the reason why it sticks out, but I can't verbalize it. I think it's over when it comes to html rules.
correction If you post multiple times with the modified code, there is each part at the top, so the trouble list and the category on the left All displayed sweat Correctly below
top_page>index.html.haml
.top
%ul.top__side
Genre
%li.top__side__love
love
%li.top__side__work
jobs
%li.top__side__money
money
%li.top__side__friend
friend
%li.top__side__school
school
%li.top__side__other
Other
.top__consultation
.top__consultation__title
List of worries
- @toppages.each do |top_page|
.top__consultation__text
= top_page.contents
.top__consultation__text__time
= top_page.created_at
However, the point does not change. Just lowering one indent solved it easily lol
Recommended Posts