提交 c7befb89 编写于 作者: J Jeremy Kemper

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
上级 e4c5ddd8
*SVN*
* Generators use *.html.erb view template naming. #8278 [Tim Pope]
* Updated resource_scaffold and model generators to use short-hand style migrations [DHH]
* Updated initializer to only load #{RAILS_ENV}.rb once. Added deprecation warning for config.breakpoint_server. [Nicholas Seckar]
......
......@@ -15,7 +15,7 @@ Example:
Credit card controller with URLs like /credit_card/debit.
Controller: app/controllers/credit_card_controller.rb
Views: app/views/credit_card/debit.erb [...]
Views: app/views/credit_card/debit.html.erb [...]
Helper: app/helpers/credit_card_helper.rb
Test: test/functional/credit_card_controller_test.rb
......@@ -24,7 +24,7 @@ Modules Example:
Credit card admin controller with URLs /admin/credit_card/suspend.
Controller: app/controllers/admin/credit_card_controller.rb
Views: app/views/admin/credit_card/debit.erb [...]
Views: app/views/admin/credit_card/debit.html.erb [...]
Helper: app/helpers/admin/credit_card_helper.rb
Test: test/functional/admin/credit_card_controller_test.rb
......@@ -28,8 +28,8 @@ def manifest
# View template for each action.
actions.each do |action|
path = File.join('app/views', class_path, file_name, "#{action}.erb")
m.template 'view.erb', path,
path = File.join('app/views', class_path, file_name, "#{action}.html.erb")
m.template 'view.html.erb', path,
:assigns => { :action => action, :path => path }
end
end
......
......@@ -81,12 +81,12 @@ def manifest
m.dependency 'model', [singular_name], :collision => :skip, :skip_migration => true
# Scaffolded forms.
m.complex_template "form.erb",
m.complex_template "form.html.erb",
File.join('app/views',
controller_class_path,
controller_file_name,
"_form.erb"),
:insert => 'form_scaffolding.erb',
"_form.html.erb"),
:insert => 'form_scaffolding.html.erb',
:sandbox => lambda { create_sandbox },
:begin_mark => 'form',
:end_mark => 'eoform',
......@@ -95,11 +95,11 @@ def manifest
# Scaffolded views.
scaffold_views.each do |action|
m.template "view_#{action}.erb",
m.template "view_#{action}.html.erb",
File.join('app/views',
controller_class_path,
controller_file_name,
"#{action}.erb"),
"#{action}.html.erb"),
:assigns => { :action => action }
end
......@@ -120,10 +120,10 @@ def manifest
"#{controller_file_name}_helper.rb")
# Layout and stylesheet.
m.template 'layout.erb',
m.template 'layout.html.erb',
File.join('app/views/layouts',
controller_class_path,
"#{controller_file_name}.erb")
"#{controller_file_name}.html.erb")
m.template 'style.css', 'public/stylesheets/scaffold.css'
......@@ -133,8 +133,8 @@ def manifest
path = File.join('app/views',
controller_class_path,
controller_file_name,
"#{action}.erb")
m.template "controller:view.erb", path,
"#{action}.html.erb")
m.template "controller:view.html.erb", path,
:assigns => { :action => action, :path => path}
end
end
......
......@@ -41,13 +41,13 @@ def manifest
for action in scaffold_views
m.template(
"view_#{action}.erb",
File.join('app/views', controller_class_path, controller_file_name, "#{action}.erb")
"view_#{action}.html.erb",
File.join('app/views', controller_class_path, controller_file_name, "#{action}.html.erb")
)
end
# Layout and stylesheet.
m.template('layout.erb', File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.erb"))
m.template('layout.html.erb', File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.html.erb"))
m.template('style.css', 'public/stylesheets/scaffold.css')
m.template('model.rb', File.join('app/models', class_path, "#{file_name}.rb"))
......
......@@ -5,7 +5,7 @@ def index
@<%= table_name %> = <%= class_name %>.find(:all)
respond_to do |format|
format.html # index.erb
format.html # index.html.erb
format.xml { render :xml => @<%= table_name %> }
end
end
......@@ -16,7 +16,7 @@ def show
@<%= file_name %> = <%= class_name %>.find(params[:id])
respond_to do |format|
format.html # show.erb
format.html # show.html.erb
format.xml { render :xml => @<%= file_name %> }
end
end
......@@ -27,7 +27,7 @@ def new
@<%= file_name %> = <%= class_name %>.new
respond_to do |format|
format.html # new.erb
format.html # new.html.erb
format.xml { render :xml => @<%= file_name %> }
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册