[RUBY] Fix the view screen of the post page

For output. This time 18c7038dfaec3788b2be3c423fd05bc2-2.png

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)

adb62a3f262ca3cb8d40312aba48b4f8.png

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

Fix the view screen of the post page
Get the result of POST in Java
[No.004] Corrected the order list screen of the orderer
[Rails] Button to return to the top of the page
I saw the list view of Android development collectively
[Android Studio] [Java] How to fix the screen vertically
I can't get out of the Rails dbconsole screen
The world of clara-rules (2)
Arrangement of screen parts
Judgment of the calendar
The world of clara-rules (4)
The world of clara-rules (1)
The world of clara-rules (3)
The world of clara-rules (5)
The idea of quicksort
The idea of jQuery
[Java] Throw a request and display the screen ② (GET / POST)
[Android] Exit the activity of the transition source at the time of screen transition
[Java] Throw a request and display the screen (GET / POST)
Let's take a look at the screen of Quant Analyzer!
Delete all the contents of the list page [Ruby on Rails]
Prevent other users from going to the post edit screen