diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-07 13:14:05 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-07 13:14:05 +0000 |
commit | daee6fd92ac16878f6806c3382a9e74592aa9656 (patch) | |
tree | d477c6502960cb141403f8b4640dd483b487e5df /railties/generators | |
parent | 838c5a3d82367977d13ced01f9e28c22ccff32ef (diff) | |
download | rails-daee6fd92ac16878f6806c3382a9e74592aa9656.tar.gz rails-daee6fd92ac16878f6806c3382a9e74592aa9656.tar.bz2 rails-daee6fd92ac16878f6806c3382a9e74592aa9656.zip |
Added new generator framework that informs about its doings on generation and enables updating and destruction of generated artifacts. See the new script/destroy and script/update for more details #487 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@518 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/generators')
28 files changed, 0 insertions, 558 deletions
diff --git a/railties/generators/controller/USAGE b/railties/generators/controller/USAGE deleted file mode 100644 index e653d7e7ec..0000000000 --- a/railties/generators/controller/USAGE +++ /dev/null @@ -1,28 +0,0 @@ -GENERATOR - controller - create controller and view stub files - -SYNOPSIS - generate controller ControllerName action [action ...] - -DESCRIPTION - The controller generator takes the name of the new controller as the - first argument and a variable number of view names as subsequent arguments. - The controller name should be supplied without a "Controller" suffix. The - generator will add that itself. - - Controller generates a controller file in app/controllers with a render - action for each of the view names passed, a test suite in test/functional - with one passing test case, and HTML stubs for each view in app/views - under a directory with the same name as the controller. - -EXAMPLE - ./script/generate controller Blog list display new edit - - This will generate a BlogController class in - app/controllers/blog_controller.rb, a BlogHelper class in - app/helpers/blog_helper.rb and a BlogControllerTest in - test/functional/blog_controller_test.rb, and list.rhtml, - display.rhtml, new.rhtml, and edit.rhtml in app/views/blog. - - The BlogController class will have list, display, new, and edit actions. - Each action will render the associated view by default. diff --git a/railties/generators/controller/controller_generator.rb b/railties/generators/controller/controller_generator.rb deleted file mode 100644 index 79f9a7e03b..0000000000 --- a/railties/generators/controller/controller_generator.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'rails_generator' - -class ControllerGenerator < Rails::Generator::Base - attr_reader :actions - - def generate - @actions = args - - # Controller class, functional test, and helper class. - template "controller.rb", "app/controllers/#{file_name}_controller.rb" - template "functional_test.rb", "test/functional/#{file_name}_controller_test.rb" - template "helper.rb", "app/helpers/#{file_name}_helper.rb" - - # Create the views directory even if there are no actions. - FileUtils.mkdir_p "app/views/#{file_name}" - - # Create a view for each action. - actions.each do |action| - template "view.rhtml", "app/views/#{file_name}/#{action}.rhtml", binding - end - end - - def full_class_name - class_name + "Controller" - end -end diff --git a/railties/generators/controller/templates/controller.rb b/railties/generators/controller/templates/controller.rb deleted file mode 100644 index 0daf04b348..0000000000 --- a/railties/generators/controller/templates/controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -class <%= full_class_name %> < ApplicationController -<% if options[:scaffold] -%> - scaffold :<%= singular_name %> -<% end -%> -<% for action in actions -%> - - def <%= action %> - end -<% end -%> -end diff --git a/railties/generators/controller/templates/functional_test.rb b/railties/generators/controller/templates/functional_test.rb deleted file mode 100644 index df75ad57e9..0000000000 --- a/railties/generators/controller/templates/functional_test.rb +++ /dev/null @@ -1,17 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require '<%= file_name %>_controller' - -# Re-raise errors caught by the controller. -class <%= full_class_name %>; def rescue_action(e) raise e end; end - -class <%= full_class_name %>Test < Test::Unit::TestCase - def setup - @controller = <%= full_class_name %>.new - @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new - end - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/railties/generators/controller/templates/helper.rb b/railties/generators/controller/templates/helper.rb deleted file mode 100644 index 3fe2ecdc74..0000000000 --- a/railties/generators/controller/templates/helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module <%= class_name %>Helper -end diff --git a/railties/generators/controller/templates/view.rhtml b/railties/generators/controller/templates/view.rhtml deleted file mode 100644 index 7e7a7d53ce..0000000000 --- a/railties/generators/controller/templates/view.rhtml +++ /dev/null @@ -1,2 +0,0 @@ -<h1><%= class_name %>#<%= action %></h1> -<p>Find me in app/views/<%= file_name %>/<%= action %>.rhtml</p> diff --git a/railties/generators/mailer/USAGE b/railties/generators/mailer/USAGE deleted file mode 100644 index 8cfc7e59c9..0000000000 --- a/railties/generators/mailer/USAGE +++ /dev/null @@ -1,27 +0,0 @@ -GENERATOR - mailer - create mailer and view stub files - -SYNOPSIS - generate mailer MailerName action [action ...] - -DESCRIPTION - The mailer generator takes the name of the new mailer class as the - first argument and a variable number of mail action names as subsequent - arguments. - - Mailer generates a class file in app/models with action methods for each - of the mail action names passed, a test suite in test/unit with a stub - test case and fixture per action, and template stubs for each action in - app/views under a directory with the same name as the class. - -EXAMPLE - ./script/generate mailer Notifications signup forgot_password invoice - - This will generate a Notifications class in - app/models/notifications.rb, a NotificationsTest in - test/unit/notifications_test.rb, and signup, forgot_password, and invoice - in test/fixture/notification. It will also create signup.rhtml, - forgot_password.rhtml, and invoice.rhtml in app/views/notifications. - - The Notifications class will have the following methods: signup, - forgot_password, and invoice. diff --git a/railties/generators/mailer/mailer_generator.rb b/railties/generators/mailer/mailer_generator.rb deleted file mode 100644 index ae0ad6bbe4..0000000000 --- a/railties/generators/mailer/mailer_generator.rb +++ /dev/null @@ -1,22 +0,0 @@ -require 'rails_generator' - -class MailerGenerator < Rails::Generator::Base - attr_reader :actions - - def generate - @actions = args - - # Mailer class and unit test. - template "mailer.rb", "app/models/#{file_name}.rb" - template "unit_test.rb", "test/unit/#{file_name}_test.rb" - - # Test fixtures directory. - FileUtils.mkdir_p "test/fixtures/#{table_name}" - - # View template and fixture for each action. - args.each do |action| - template "view.rhtml", "app/views/#{file_name}/#{action}.rhtml", binding - template "fixture.rhtml", "test/fixtures/#{table_name}/#{action}", binding - end - end -end diff --git a/railties/generators/mailer/templates/fixture.rhtml b/railties/generators/mailer/templates/fixture.rhtml deleted file mode 100644 index b481906829..0000000000 --- a/railties/generators/mailer/templates/fixture.rhtml +++ /dev/null @@ -1,3 +0,0 @@ -<%= class_name %>#<%= action %> - -Find me in app/views/<%= file_name %>/<%= action %>.rhtml diff --git a/railties/generators/mailer/templates/mailer.rb b/railties/generators/mailer/templates/mailer.rb deleted file mode 100644 index 81c19fa76d..0000000000 --- a/railties/generators/mailer/templates/mailer.rb +++ /dev/null @@ -1,13 +0,0 @@ -class <%= class_name %> < ActionMailer::Base -<% for action in actions -%> - - def <%= action %>(sent_on = Time.now) - @subject = '<%= class_name %>#<%= action %>' - @body = {} - @recipients = '' - @from = '' - @sent_on = sent_on - @headers = {} - end -<% end -%> -end diff --git a/railties/generators/mailer/templates/unit_test.rb b/railties/generators/mailer/templates/unit_test.rb deleted file mode 100644 index 70fd3afe37..0000000000 --- a/railties/generators/mailer/templates/unit_test.rb +++ /dev/null @@ -1,29 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require '<%= file_name %>' - -class <%= class_name %>Test < Test::Unit::TestCase - FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures' - - def setup - ActionMailer::Base.delivery_method = :test - ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] - - @expected = TMail::Mail.new - end - -<% for action in actions -%> - def test_<%= action %> - @expected.subject = '<%= class_name %>#<%= action %>' - @expected.body = read_fixture('<%= action %>') - @expected.date = Time.now - - assert_equal @expected.encoded, <%= class_name %>.create_<%= action %>(@expected.date).encoded - end - -<% end -%> - private - def read_fixture(action) - IO.readlines("#{FIXTURES_PATH}/<%= file_name %>/#{action}") - end -end diff --git a/railties/generators/mailer/templates/view.rhtml b/railties/generators/mailer/templates/view.rhtml deleted file mode 100644 index b481906829..0000000000 --- a/railties/generators/mailer/templates/view.rhtml +++ /dev/null @@ -1,3 +0,0 @@ -<%= class_name %>#<%= action %> - -Find me in app/views/<%= file_name %>/<%= action %>.rhtml diff --git a/railties/generators/model/USAGE b/railties/generators/model/USAGE index 50ab3a8f09..e69de29bb2 100644 --- a/railties/generators/model/USAGE +++ b/railties/generators/model/USAGE @@ -1,17 +0,0 @@ -GENERATOR - model - create model stub files - -SYNOPSIS - generate model ModelName - -DESCRIPTION - The model generator takes a model name and generates an empty model in - app/models, a test suite in test/unit with one passing test case, and a - fixtures YAML file in the test/fixtures directory. - -EXAMPLE - ./script/generate model Account - - This will generate an Account class in app/models/account.rb, an - AccountTest in test/unit/account_test.rb, and the fixtures file - test/fixtures/account.yml. diff --git a/railties/generators/model/model_generator.rb b/railties/generators/model/model_generator.rb deleted file mode 100644 index 04540d6e40..0000000000 --- a/railties/generators/model/model_generator.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'rails_generator' - -class ModelGenerator < Rails::Generator::Base - def generate - # Model class, unit test, and fixtures. - template "model.rb", "app/models/#{file_name}.rb" - template "unit_test.rb", "test/unit/#{file_name}_test.rb" - template "fixtures.yml", "test/fixtures/#{table_name}.yml" - end -end diff --git a/railties/generators/model/templates/fixtures.yml b/railties/generators/model/templates/fixtures.yml deleted file mode 100644 index a56c16462a..0000000000 --- a/railties/generators/model/templates/fixtures.yml +++ /dev/null @@ -1 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html diff --git a/railties/generators/model/templates/model.rb b/railties/generators/model/templates/model.rb deleted file mode 100644 index 8d4c89e912..0000000000 --- a/railties/generators/model/templates/model.rb +++ /dev/null @@ -1,2 +0,0 @@ -class <%= class_name %> < ActiveRecord::Base -end diff --git a/railties/generators/model/templates/unit_test.rb b/railties/generators/model/templates/unit_test.rb deleted file mode 100644 index cc8b2e5910..0000000000 --- a/railties/generators/model/templates/unit_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class <%= class_name %>Test < Test::Unit::TestCase - fixtures :<%= table_name %> - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/railties/generators/scaffold/USAGE b/railties/generators/scaffold/USAGE deleted file mode 100644 index a8c9ed8967..0000000000 --- a/railties/generators/scaffold/USAGE +++ /dev/null @@ -1,27 +0,0 @@ -GENERATOR - scaffold - create a model and basic controller - -SYNOPSIS - generate scaffold ModelName [ControllerName] [action ...] - -DESCRIPTION - The scaffold generator takes the name of the new model as the - first argument, an optional controller name as the second, and - an optional list of controller actions as the subsequent arguments. - If the controller name is not specified, the plural form of the model - name will be used. Any actions with scaffolding code available - will be generated in your controller; others will be left as stubs. - - The generated controller has the same code that "scaffold :model" - uses, so it's easy to migrate when you want to start customizing - your controller. - -EXAMPLE - ./script/generate scaffold Account Bank debit credit - - This will generate the Account model with unit tests and fixtures, - the BankController controller with actions, views, and tests for - index, list, show, new, create, edit, update, and destroy. - - Now create the accounts table in your database and browse to - http://localhost/bank/ -- voila, you're on Rails! diff --git a/railties/generators/scaffold/scaffold_generator.rb b/railties/generators/scaffold/scaffold_generator.rb deleted file mode 100644 index 3901d6b2bc..0000000000 --- a/railties/generators/scaffold/scaffold_generator.rb +++ /dev/null @@ -1,60 +0,0 @@ -require 'rails_generator' - -class ScaffoldGenerator < Rails::Generator::Base - def generate - # Model. - generator('model').generate - - # Fixtures. - template "fixtures.yml", "test/fixtures/#{table_name}.yml" - - @controller_class_name = args.empty? ? Inflector.pluralize(class_name) : args.shift.sub(/^[a-z]?/) { |m| m.capitalize } - @controller_name = Inflector.underscore(@controller_class_name) - - # Controller class, functional test, helper, and views. - template "controller.rb", "app/controllers/#{@controller_name}_controller.rb" - template "functional_test.rb", "test/functional/#{@controller_name}_controller_test.rb" - template "controller/helper.rb", "app/helpers/#{@controller_name}_helper.rb" - - # Layout and stylesheet. - unless File.file?("app/views/layouts/#{@controller_name}.rhtml") - template "layout.rhtml", "app/views/layouts/#{@controller_name}.rhtml" - end - unless File.file?("public/stylesheets/scaffold.css") - template "style.css", "public/stylesheets/scaffold.css" - end - - # Scaffolded views. - scaffold_views.each do |action| - template "view_#{action}.rhtml", "app/views/#{@controller_name}/#{action}.rhtml" - end - - # Unscaffolded views. - unscaffolded_actions.each do |action| - template "controller/view.rhtml", - "app/views/#{@controller_name}/#{action}.rhtml", - binding - end - end - - def full_class_name - class_name + "Controller" - end - - protected - def scaffold_views - %w(list show new edit) - end - - def scaffold_actions - scaffold_views + %w(index create update destroy) - end - - def unscaffolded_actions - args - scaffold_actions - end - - def suffix - "_#{singular_name}" if options[:suffix] - end -end 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 %>' %> |