Created
June 24, 2014 10:59
-
-
Save nakaearth/d69f2ec7eb314dd29cc1 to your computer and use it in GitHub Desktop.
active_decoratorを使ったindex.html.erb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Listing users</h1> | |
<table> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Age</th> | |
<th colspan="3"></th> | |
</tr> | |
</thead> | |
<tbody> | |
<% @users.each do |user| %> | |
<tr> | |
<td><%= user.name %>(<%= user.short_name %>)</td> | |
<td><%= user.age %></td> | |
<td><%= link_to 'Show', user %></td> | |
<td><%= link_to 'Edit', edit_user_path(user) %></td> | |
<td><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %></td> | |
</tr> | |
<% end %> | |
</tbody> | |
</table> | |
<br> | |
<%= link_to 'New User', new_user_path %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment