Ruby on Rails
/views/modelname/action.index.erb
.erb
files are ruby templates. <%
for code, and <%=
to evaluate expressions.<h1>Listing posts</h1> <% for post in @posts %> <h2><%=h post.title %></h2> <p><%=h post.body %></p> <p><%= link_to 'Show', post %> <%= link_to 'Edit', edit_post_path(post) %> <%= link_to 'Destroy', post, :confirm => 'Are you sure?', :method => :delete %></p> <% end %> <br/> <%= link_to 'New post', new_post_path %>
10 of 16