[Output] About each

About each What to do It has the function of repeating the contents of the array Example) <% @posts.each do |post| %> posts is the variable name post is the one that puts the contents of the array for the time being < div class = "posts-index-item">

< % = post.content %> There is a situation where only post is good here. This time I am taking an array with Post.all in the terminal (because there is data in the column name content) < /div> <% end %>

To give an example, it became more complicated, but if I wrote each when writing repetitive processing You can write it short.

Recommended Posts

[Output] About each
About Java log output
Output about the method # 2
[Output] About the database
Output about the method Part 1
About =
[Ruby] Review about nesting of each
About method.invoke
About Kotlin
About attr_accessor
About Hinemos
About inheritance
About params
About Docker
About Rails 6
About form_for
About Spring ③
About enum
About polymorphism
About Optional
About JitPack
About Dockerfile
2020/10/4 noon output
Learning output ~ 11/3 ~
About encapsulation
About Docker
About JAVA_HOME
About active_hash
About static
About exceptions
2020/10/5 Morning output
Learning output
About scope
2020/10/3 Noon output
[Maven] About Maven
2020/10/3 Morning output
Try scraping about 30 lines in Java (CSV output)