diff options
Diffstat (limited to 'railties/lib/rails_generator/generators/components/scaffold/templates')
14 files changed, 73 insertions, 73 deletions
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/form.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/form.erb new file mode 100644 index 0000000000..d15f0d4ec2 --- /dev/null +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/form.erb @@ -0,0 +1,3 @@ +<%%= error_messages_for '<%= singular_name %>' %> + +<%= template_for_inclusion %> diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml index d15f0d4ec2..e69de29bb2 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml @@ -1,3 +0,0 @@ -<%%= error_messages_for '<%= singular_name %>' %> - -<%= template_for_inclusion %> diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.erb new file mode 100644 index 0000000000..c7a87553ac --- /dev/null +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.erb @@ -0,0 +1 @@ +<%= all_input_tags(@model_instance, @singular_name, {}) %>
\ No newline at end of file diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml index c7a87553ac..e69de29bb2 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml @@ -1 +0,0 @@ -<%= all_input_tags(@model_instance, @singular_name, {}) %>
\ No newline at end of file diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/layout.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/layout.erb new file mode 100644 index 0000000000..5c1f304232 --- /dev/null +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/layout.erb @@ -0,0 +1,17 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> + <title><%= controller_class_name %>: <%%= controller.action_name %></title> + <%%= stylesheet_link_tag 'scaffold' %> +</head> +<body> + +<p style="color: green"><%%= flash[:notice] %></p> + +<%%= yield %> + +</body> +</html> diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml index 5c1f304232..e69de29bb2 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml @@ -1,17 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> - <title><%= controller_class_name %>: <%%= controller.action_name %></title> - <%%= stylesheet_link_tag 'scaffold' %> -</head> -<body> - -<p style="color: green"><%%= flash[:notice] %></p> - -<%%= yield %> - -</body> -</html> diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.erb new file mode 100644 index 0000000000..a86aa0b0d5 --- /dev/null +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.erb @@ -0,0 +1,9 @@ +<h1>Editing <%= singular_name %></h1> + +<%% form_tag :action => 'update<%= @suffix %>', :id => @<%= singular_name %> do %> + <%%= render :partial => 'form' %> + <%%= submit_tag 'Edit' %> +<%% end %> + +<%%= link_to 'Show', :action => 'show<%= suffix %>', :id => @<%= singular_name %> %> | +<%%= link_to 'Back', :action => 'list<%= suffix %>' %> diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml index a86aa0b0d5..e69de29bb2 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml @@ -1,9 +0,0 @@ -<h1>Editing <%= singular_name %></h1> - -<%% form_tag :action => 'update<%= @suffix %>', :id => @<%= singular_name %> do %> - <%%= render :partial => 'form' %> - <%%= submit_tag 'Edit' %> -<%% end %> - -<%%= link_to 'Show', :action => 'show<%= suffix %>', :id => @<%= singular_name %> %> | -<%%= link_to 'Back', :action => 'list<%= suffix %>' %> diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.erb new file mode 100644 index 0000000000..3e2a414485 --- /dev/null +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.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 %>' %> diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml index 3e2a414485..e69de29bb2 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml @@ -1,27 +0,0 @@ -<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 %>' %> diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.erb new file mode 100644 index 0000000000..8222ea622f --- /dev/null +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.erb @@ -0,0 +1,8 @@ +<h1>New <%= singular_name %></h1> + +<%% form_tag :action => 'create<%= @suffix %>' do %> + <%%= render :partial => 'form' %> + <%%= submit_tag "Create" %> +<%% end %> + +<%%= link_to 'Back', :action => 'list<%= suffix %>' %> diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml index 8222ea622f..e69de29bb2 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml @@ -1,8 +0,0 @@ -<h1>New <%= singular_name %></h1> - -<%% form_tag :action => 'create<%= @suffix %>' do %> - <%%= render :partial => 'form' %> - <%%= submit_tag "Create" %> -<%% end %> - -<%%= link_to 'Back', :action => 'list<%= suffix %>' %> diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.erb new file mode 100644 index 0000000000..c9245cdfda --- /dev/null +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.erb @@ -0,0 +1,8 @@ +<%% for column in <%= model_name %>.content_columns %> +<p> + <b><%%= column.human_name %>:</b> <%%=h @<%= singular_name %>.send(column.name) %> +</p> +<%% end %> + +<%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => @<%= singular_name %> %> | +<%%= link_to 'Back', :action => 'list<%= suffix %>' %> diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml index c9245cdfda..e69de29bb2 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml @@ -1,8 +0,0 @@ -<%% for column in <%= model_name %>.content_columns %> -<p> - <b><%%= column.human_name %>:</b> <%%=h @<%= singular_name %>.send(column.name) %> -</p> -<%% end %> - -<%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => @<%= singular_name %> %> | -<%%= link_to 'Back', :action => 'list<%= suffix %>' %> |