Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit c7befb896e72e6087d2d413990d319c990154c7e 1 parent e4c5ddd
@jeremy jeremy authored
Showing with 21 additions and 19 deletions.
  1. +2 −0  railties/CHANGELOG
  2. +2 −2 railties/lib/rails_generator/generators/components/controller/USAGE
  3. +2 −2 railties/lib/rails_generator/generators/components/controller/controller_generator.rb
  4. 0  railties/lib/rails_generator/generators/components/controller/templates/{view.erb → view.html.erb}
  5. 0  railties/lib/rails_generator/generators/components/controller/templates/view.rhtml
  6. +9 −9 railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb
  7. 0  railties/lib/rails_generator/generators/components/scaffold/templates/{form.erb → form.html.erb}
  8. 0  railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml
  9. 0  ..._generator/generators/components/scaffold/templates/{form_scaffolding.erb → form_scaffolding.html.erb}
  10. 0  railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml
  11. 0  ...or/generators/components/{scaffold_resource/templates/layout.erb → scaffold/templates/layout.html.erb}
  12. 0  railties/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml
  13. 0  ...ties/lib/rails_generator/generators/components/scaffold/templates/{view_edit.erb → view_edit.html.erb}
  14. 0  railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml
  15. 0  ...ties/lib/rails_generator/generators/components/scaffold/templates/{view_list.erb → view_list.html.erb}
  16. 0  railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml
  17. 0  railties/lib/rails_generator/generators/components/scaffold/templates/{view_new.erb → view_new.html.erb}
  18. 0  railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml
  19. 0  ...ties/lib/rails_generator/generators/components/scaffold/templates/{view_show.erb → view_show.html.erb}
  20. 0  railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml
  21. +3 −3 railties/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb
  22. +3 −3 railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb
  23. 0  ...or/generators/components/{scaffold/templates/layout.erb → scaffold_resource/templates/layout.html.erb}
  24. 0  ...rails_generator/generators/components/scaffold_resource/templates/{view_edit.erb → view_edit.html.erb}
  25. 0  ...ils_generator/generators/components/scaffold_resource/templates/{view_index.erb → view_index.html.erb}
  26. 0  ...b/rails_generator/generators/components/scaffold_resource/templates/{view_new.erb → view_new.html.erb}
  27. 0  ...rails_generator/generators/components/scaffold_resource/templates/{view_show.erb → view_show.html.erb}
View
2  railties/CHANGELOG
@@ -1,5 +1,7 @@
*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]
View
4 railties/lib/rails_generator/generators/components/controller/USAGE
@@ -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
View
4 railties/lib/rails_generator/generators/components/controller/controller_generator.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
View
0  .../components/controller/templates/view.erb → ...onents/controller/templates/view.html.erb
File renamed without changes
View
0  railties/lib/rails_generator/generators/components/controller/templates/view.rhtml
No changes.
View
18 railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb
@@ -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
View
0  ...rs/components/scaffold/templates/form.erb → ...mponents/scaffold/templates/form.html.erb
File renamed without changes
View
0  railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml
No changes.
View
0  ...s/scaffold/templates/form_scaffolding.erb → ...ffold/templates/form_scaffolding.html.erb
File renamed without changes
View
0  railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml
No changes.
View
0  ...ts/scaffold_resource/templates/layout.erb → ...onents/scaffold/templates/layout.html.erb
File renamed without changes
View
0  railties/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml
No changes.
View
0  ...mponents/scaffold/templates/view_edit.erb → ...nts/scaffold/templates/view_edit.html.erb
File renamed without changes
View
0  railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml
No changes.
View
0  ...mponents/scaffold/templates/view_list.erb → ...nts/scaffold/templates/view_list.html.erb
File renamed without changes
View
0  railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml
No changes.
View
0  ...omponents/scaffold/templates/view_new.erb → ...ents/scaffold/templates/view_new.html.erb
File renamed without changes
View
0  railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml
No changes.
View
0  ...mponents/scaffold/templates/view_show.erb → ...nts/scaffold/templates/view_show.html.erb
File renamed without changes
View
0  railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml
No changes.
View
6 ...ib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb
@@ -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"))
View
6 railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.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
View
0  .../components/scaffold/templates/layout.erb → ...affold_resource/templates/layout.html.erb
File renamed without changes
View
0  ...scaffold_resource/templates/view_edit.erb → ...old_resource/templates/view_edit.html.erb
File renamed without changes
View
0  ...caffold_resource/templates/view_index.erb → ...ld_resource/templates/view_index.html.erb
File renamed without changes
View
0  .../scaffold_resource/templates/view_new.erb → ...fold_resource/templates/view_new.html.erb
File renamed without changes
View
0  ...scaffold_resource/templates/view_show.erb → ...old_resource/templates/view_show.html.erb
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.