I am just starting out with Ruby on Rails and to practice, I am creating a simple blogging app. On the page I created to view the list of all posts, all the data that is passed to the page is being rendered in an array near the top of the page like so:

I can't figure out why the array is showing. Here's the controller for that page:
def index
@posts = Post.all
end
And heres the view:
<h1>Listing posts</h1>
<table>
<tr>
<th>Title</th>
<th>Text</th>
</tr>
<%= @posts.each do |post| %>
<tr>
<td><%= post.title %></td>
<td><%= post.text %> </td>
</tr>
<% end %>
</table>
and for the route I have tried both:
get '/posts/(.:format)' => 'posts#index'
and
get '/posts' => 'posts#index'
Also as a side question, what does (.:format) do anyway? The page seems to work the same whether I include that in the route or not.