diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-06 10:34:18 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-06 10:34:18 +0000 |
commit | c7befb896e72e6087d2d413990d319c990154c7e (patch) | |
tree | a6cde8d298baf86cdca519e67fe367a9a9274d6b /railties/lib/rails_generator/generators/components/scaffold/templates/view_list.html.erb | |
parent | e4c5ddd83954a04be72f738f2f1c60739aacdd76 (diff) | |
download | rails-c7befb896e72e6087d2d413990d319c990154c7e.tar.gz rails-c7befb896e72e6087d2d413990d319c990154c7e.tar.bz2 rails-c7befb896e72e6087d2d413990d319c990154c7e.zip |
Generators use *.html.erb view template naming. Closes #8278.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6690 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator/generators/components/scaffold/templates/view_list.html.erb')
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold/templates/view_list.html.erb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.html.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.html.erb new file mode 100644 index 0000000000..3e2a414485 --- /dev/null +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.html.erb @@ -0,0 +1,27 @@ +<h1>Listing <%= plural_name %></h1> + +<table> + <tr> + <%% for column in <%= model_name %>.content_columns %> + <th><%%= column.human_name %></th> + <%% end %> + </tr> + +<%% for <%= singular_name %> in @<%= plural_name %> %> + <tr> + <%% for column in <%= model_name %>.content_columns %> + <td><%%=h <%= singular_name %>.send(column.name) %></td> + <%% end %> + <td><%%= link_to 'Show', :action => 'show<%= suffix %>', :id => <%= singular_name %> %></td> + <td><%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => <%= singular_name %> %></td> + <td><%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?', :method => :post %></td> + </tr> +<%% end %> +</table> + +<%%= link_to 'Previous page', { :page => @<%= singular_name %>_pages.current.previous } if @<%= singular_name %>_pages.current.previous %> +<%%= link_to 'Next page', { :page => @<%= singular_name %>_pages.current.next } if @<%= singular_name %>_pages.current.next %> + +<br /> + +<%%= link_to 'New <%= singular_name %>', :action => 'new<%= suffix %>' %> |