aboutsummaryrefslogtreecommitdiffstats
path: root/railties/generators/scaffold/templates
diff options
context:
space:
mode:
Diffstat (limited to 'railties/generators/scaffold/templates')
-rw-r--r--railties/generators/scaffold/templates/controller.rb54
-rw-r--r--railties/generators/scaffold/templates/fixtures.yml7
-rw-r--r--railties/generators/scaffold/templates/functional_test.rb79
-rw-r--r--railties/generators/scaffold/templates/layout.rhtml11
-rw-r--r--railties/generators/scaffold/templates/style.css53
-rw-r--r--railties/generators/scaffold/templates/view_edit.rhtml7
-rw-r--r--railties/generators/scaffold/templates/view_list.rhtml24
-rw-r--r--railties/generators/scaffold/templates/view_new.rhtml6
-rw-r--r--railties/generators/scaffold/templates/view_show.rhtml8
9 files changed, 0 insertions, 249 deletions
diff --git a/railties/generators/scaffold/templates/controller.rb b/railties/generators/scaffold/templates/controller.rb
deleted file mode 100644
index 7ccb517bee..0000000000
--- a/railties/generators/scaffold/templates/controller.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-class <%= @controller_class_name %>Controller < ApplicationController
-<% unless suffix -%>
- def index
- list
- render_action 'list'
- end
-<% end -%>
-
-<% for action in unscaffolded_actions -%>
- def <%= action %><%= suffix %>
- end
-
-<% end -%>
- def list<%= suffix %>
- @<%= plural_name %> = <%= class_name %>.find_all
- end
-
- def show<%= suffix %>
- @<%= singular_name %> = <%= class_name %>.find(@params['id'])
- end
-
- def new<%= suffix %>
- @<%= singular_name %> = <%= class_name %>.new
- end
-
- def create<%= suffix %>
- @<%= singular_name %> = <%= class_name %>.new(@params['<%= singular_name %>'])
- if @<%= singular_name %>.save
- flash['notice'] = '<%= class_name %> was successfully created.'
- redirect_to :action => 'list<%= suffix %>'
- else
- render_action 'new<%= suffix %>'
- end
- end
-
- def edit<%= suffix %>
- @<%= singular_name %> = <%= class_name %>.find(@params['id'])
- end
-
- def update
- @<%= singular_name %> = <%= class_name %>.find(@params['<%= singular_name %>']['id'])
- if @<%= singular_name %>.update_attributes(@params['<%= singular_name %>'])
- flash['notice'] = '<%= class_name %> was successfully updated.'
- redirect_to :action => 'show<%= suffix %>', :id => @<%= singular_name %>.id
- else
- render_action 'edit<%= suffix %>'
- end
- end
-
- def destroy<%= suffix %>
- <%= class_name %>.find(@params['id']).destroy
- redirect_to :action => 'list<%= suffix %>'
- end
-end
diff --git a/railties/generators/scaffold/templates/fixtures.yml b/railties/generators/scaffold/templates/fixtures.yml
deleted file mode 100644
index ea67f36ad8..0000000000
--- a/railties/generators/scaffold/templates/fixtures.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
-
-first_<%= singular_name %>:
- id: 1
-
-another_<%= singular_name %>:
- id: 2
diff --git a/railties/generators/scaffold/templates/functional_test.rb b/railties/generators/scaffold/templates/functional_test.rb
deleted file mode 100644
index 004af030be..0000000000
--- a/railties/generators/scaffold/templates/functional_test.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-require File.dirname(__FILE__) + '/../test_helper'
-require '<%= @controller_name %>_controller'
-
-# Re-raise errors caught by the controller.
-class <%= @controller_class_name %>Controller; def rescue_action(e) raise e end; end
-
-class <%= @controller_class_name %>ControllerTest < Test::Unit::TestCase
- fixtures :<%= table_name %>
-
- def setup
- @controller = <%= @controller_class_name %>Controller.new
- @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new
- end
-
-<% for action in unscaffolded_actions -%>
- def test_<%= action %>
- process :<%= action %>
- assert_rendered_file '<%= action %>'
- end
-
-<% end -%>
-<% unless suffix -%>
- def test_index
- process :index
- assert_rendered_file 'list'
- end
-
-<% end -%>
- def test_list<%= suffix %>
- process :list<%= suffix %>
- assert_rendered_file 'list<%= suffix %>'
- assert_template_has '<%= plural_name %>'
- end
-
- def test_show<%= suffix %>
- process :show<%= suffix %>, 'id' => 1
- assert_rendered_file 'show'
- assert_template_has '<%= singular_name %>'
- assert_valid_record '<%= singular_name %>'
- end
-
- def test_new<%= suffix %>
- process :new<%= suffix %>
- assert_rendered_file 'new<%= suffix %>'
- assert_template_has '<%= singular_name %>'
- end
-
- def test_create
- num_<%= plural_name %> = <%= class_name %>.find_all.size
-
- process :create<%= suffix %>, '<%= singular_name %>' => { }
- assert_redirected_to :action => 'list<%= suffix %>'
-
- assert_equal num_<%= plural_name %> + 1, <%= class_name %>.find_all.size
- end
-
- def test_edit<%= suffix %>
- process :edit<%= suffix %>, 'id' => 1
- assert_rendered_file 'edit<%= suffix %>'
- assert_template_has '<%= singular_name %>'
- assert_valid_record '<%= singular_name %>'
- end
-
- def test_update<%= suffix %>
- process :update<%= suffix %>, '<%= singular_name %>' => { 'id' => 1 }
- assert_redirected_to :action => 'show<%= suffix %>', :id => 1
- end
-
- def test_destroy<%= suffix %>
- assert_not_nil <%= class_name %>.find(1)
-
- process :destroy, 'id' => 1
- assert_redirected_to :action => 'list<%= suffix %>'
-
- assert_raise(ActiveRecord::RecordNotFound) {
- <%= singular_name %> = <%= class_name %>.find(1)
- }
- end
-end
diff --git a/railties/generators/scaffold/templates/layout.rhtml b/railties/generators/scaffold/templates/layout.rhtml
deleted file mode 100644
index 59d5585b51..0000000000
--- a/railties/generators/scaffold/templates/layout.rhtml
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<head>
- <title>Scaffolding: <%%= controller.controller_name %>#<%%= controller.action_name %></title>
- <link href="/stylesheets/scaffold.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
-
-<%%= @content_for_layout %>
-
-</body>
-</html>
diff --git a/railties/generators/scaffold/templates/style.css b/railties/generators/scaffold/templates/style.css
deleted file mode 100644
index 8f512501bf..0000000000
--- a/railties/generators/scaffold/templates/style.css
+++ /dev/null
@@ -1,53 +0,0 @@
-body { background-color: #fff; color: #333; }
-
-body, p, ol, ul, td {
- font-family: verdana, arial, helvetica, sans-serif;
- font-size: 13px;
- line-height: 18px;
-}
-
-pre {
- background-color: #eee;
- padding: 10px;
- font-size: 11px;
-}
-
-a { color: #000; }
-a:visited { color: #666; }
-a:hover { color: #fff; background-color:#000; }
-
-.fieldWithErrors {
- padding: 2px;
- background-color: red;
- display: table;
-}
-
-#ErrorExplanation {
- width: 400px;
- border: 2px solid #red;
- padding: 7px;
- padding-bottom: 12px;
- margin-bottom: 20px;
- background-color: #f0f0f0;
-}
-
-#ErrorExplanation h2 {
- text-align: left;
- font-weight: bold;
- padding: 5px 5px 5px 15px;
- font-size: 12px;
- margin: -7px;
- background-color: #c00;
- color: #fff;
-}
-
-#ErrorExplanation p {
- color: #333;
- margin-bottom: 0;
- padding: 5px;
-}
-
-#ErrorExplanation ul li {
- font-size: 12px;
- list-style: square;
-}
diff --git a/railties/generators/scaffold/templates/view_edit.rhtml b/railties/generators/scaffold/templates/view_edit.rhtml
deleted file mode 100644
index 260b0ebda1..0000000000
--- a/railties/generators/scaffold/templates/view_edit.rhtml
+++ /dev/null
@@ -1,7 +0,0 @@
-<h1>Editing <%= singular_name %></h1>
-
-<%%= error_messages_for '<%= singular_name %>' %>
-<%%= form '<%= singular_name %>', :action => 'update<%= suffix %>' %>
-
-<%%= link_to 'Show', :action => 'show<%= suffix %>', :id => @<%= singular_name %>.id %> |
-<%%= link_to 'Back', :action => 'list<%= suffix %>' %>
diff --git a/railties/generators/scaffold/templates/view_list.rhtml b/railties/generators/scaffold/templates/view_list.rhtml
deleted file mode 100644
index 068fd67472..0000000000
--- a/railties/generators/scaffold/templates/view_list.rhtml
+++ /dev/null
@@ -1,24 +0,0 @@
-<h1>Listing <%= plural_name %></h1>
-
-<table>
- <tr>
-<%% for column in <%= class_name %>.content_columns %>
- <th><%%= column.human_name %></th>
-<%% end %>
- </tr>
-
-<%% for <%= singular_name %> in @<%= plural_name %> %>
- <tr>
- <%% for column in <%= class_name %>.content_columns %>
- <td><%%=h <%= singular_name %>[column.name] %></td>
- <%% end %>
- <td><%%= link_to 'Show', :action => 'show<%= suffix %>', :id => <%= singular_name %>.id %></td>
- <td><%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => <%= singular_name %>.id %></td>
- <td><%%= link_to 'Destroy', :action => 'destroy<%= suffix %>', :id => <%= singular_name %>.id %></td>
- </tr>
-<%% end %>
-</table>
-
-<br />
-
-<%%= link_to 'New <%= singular_name %>', :action => 'new<%= suffix %>' %>
diff --git a/railties/generators/scaffold/templates/view_new.rhtml b/railties/generators/scaffold/templates/view_new.rhtml
deleted file mode 100644
index df68c1abbf..0000000000
--- a/railties/generators/scaffold/templates/view_new.rhtml
+++ /dev/null
@@ -1,6 +0,0 @@
-<h1>New <%= @singular_name %></h1>
-
-<%%= error_messages_for '<%= singular_name %>' %>
-<%%= form '<%= singular_name %>', :action => 'create<%= suffix %>' %>
-
-<%%= link_to 'Back', :action => 'list<%= suffix %>' %>
diff --git a/railties/generators/scaffold/templates/view_show.rhtml b/railties/generators/scaffold/templates/view_show.rhtml
deleted file mode 100644
index ba8f3616dd..0000000000
--- a/railties/generators/scaffold/templates/view_show.rhtml
+++ /dev/null
@@ -1,8 +0,0 @@
-<%% for column in <%= class_name %>.content_columns %>
-<p>
- <b><%%= column.human_name %>:</b> <%%= @<%= singular_name %>.send(column.name) %>
-</p>
-<%% end %>
-
-<%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => @<%= singular_name %>.id %> |
-<%%= link_to 'Back', :action => 'list<%= suffix %>' %>