From 9c1b1bd42ce00d43b7894daaf096eff9ee55aef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 2 Aug 2012 15:30:38 -0300 Subject: Use `:data => { :confirm => "Text" }` syntax instead of `:confirm` at the ERB scaffold generator. We are trying to teach the data attributes as best practices and `:confirm` will be deprecated in 4.0. --- railties/CHANGELOG.md | 11 ++++++++--- .../rails/generators/erb/scaffold/templates/index.html.erb | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'railties') diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 5bffe75244..2537993df3 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,16 +1,21 @@ ## Rails 3.2.8 ## -* No changes. +* ERB scaffold generator use the `:data => { :confirm => "Text" }` syntax instead of `:confirm`. + + *Rafael Mendonça França* + ## Rails 3.2.7 (Jul 26, 2012) ## -* Since Rails 3.2, use layout false to render no layout -* Use strict_args_position! if available from Thor +* Since Rails 3.2, use layout false to render no layout +* Use strict_args_position! if available from Thor + ## Rails 3.2.6 (Jun 12, 2012) ## * No changes. + ## Rails 3.2.4 (May 31, 2012) ## * Add hook for resource route's generator. *Santiago Pastorino* diff --git a/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb index 7b1a2a1841..a7c12b9026 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb +++ b/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb @@ -17,7 +17,7 @@ <% end -%> <%%= link_to 'Show', <%= singular_table_name %> %> <%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %> - <%%= link_to 'Destroy', <%= singular_table_name %>, <%= key_value :confirm, "'Are you sure?'" %>, <%= key_value :method, ":delete" %> %> + <%%= link_to 'Destroy', <%= singular_table_name %>, <%= key_value :method, ":delete" %>, <%= key_value :data, "{ #{key_value :confirm, "'Are you sure?'"} }" %> %> <%% end %> -- cgit v1.2.3