aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/erb/scaffold/templates/index.html.erb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-07-01 18:33:22 +0200
committerJosé Valim <jose.valim@gmail.com>2009-07-02 10:27:39 +0200
commit80cd16372ce1776e5d6af87b2dc7be8205fa1513 (patch)
treef2dd35f80c6bc0f050818fe6decb30c8b2e2d3e4 /railties/lib/generators/erb/scaffold/templates/index.html.erb
parent9541977e049d236564f34cf58660b61e154ccb32 (diff)
downloadrails-80cd16372ce1776e5d6af87b2dc7be8205fa1513.tar.gz
rails-80cd16372ce1776e5d6af87b2dc7be8205fa1513.tar.bz2
rails-80cd16372ce1776e5d6af87b2dc7be8205fa1513.zip
Added scaffold views to scaffold controller.
Diffstat (limited to 'railties/lib/generators/erb/scaffold/templates/index.html.erb')
-rw-r--r--railties/lib/generators/erb/scaffold/templates/index.html.erb24
1 files changed, 24 insertions, 0 deletions
diff --git a/railties/lib/generators/erb/scaffold/templates/index.html.erb b/railties/lib/generators/erb/scaffold/templates/index.html.erb
new file mode 100644
index 0000000000..427ff81e03
--- /dev/null
+++ b/railties/lib/generators/erb/scaffold/templates/index.html.erb
@@ -0,0 +1,24 @@
+<h1>Listing <%= plural_name %></h1>
+
+<table>
+ <tr>
+<% for attribute in attributes -%>
+ <th><%= attribute.human_name %></th>
+<% end -%>
+ </tr>
+
+<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
+ <tr>
+<% for attribute in attributes -%>
+ <td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>
+<% end -%>
+ <td><%%= link_to 'Show', <%= singular_name %> %></td>
+ <td><%%= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>) %></td>
+ <td><%%= link_to 'Destroy', <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<%% end %>
+</table>
+
+<br />
+
+<%%= link_to 'New <%= singular_name %>', new_<%= singular_name %>_path %>