aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2009-12-17 16:37:11 -0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2009-12-17 16:37:11 -0800
commitfa575973b1ad5adb7115a18c4c1c7c31500e73b2 (patch)
tree6fb71516dfd7e24758825093ad37337205669e26 /railties/lib/rails/generators
parent2bfa477128ef36e5664709684b51c20bebf1ee70 (diff)
downloadrails-fa575973b1ad5adb7115a18c4c1c7c31500e73b2.tar.gz
rails-fa575973b1ad5adb7115a18c4c1c7c31500e73b2.tar.bz2
rails-fa575973b1ad5adb7115a18c4c1c7c31500e73b2.zip
Added alert/notice from 2-3-stable and refactored redirect_to into just living in Redirector [DHH]
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r--railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb2
-rw-r--r--railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb6
2 files changed, 3 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb
index 6460e5b599..51c4ad0e2e 100644
--- a/railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb
+++ b/railties/lib/rails/generators/erb/scaffold/templates/layout.html.erb
@@ -7,7 +7,7 @@
</head>
<body>
-<p class="notice"><%%= flash[:notice] %></p>
+<p class="notice"><%%= notice %></p>
<%%= yield %>
diff --git a/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb b/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb
index 3cc8bbf8e7..874e96a2b4 100644
--- a/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb
+++ b/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb
@@ -46,8 +46,7 @@ class <%= controller_class_name %>Controller < ApplicationController
respond_to do |format|
if @<%= orm_instance.save %>
- flash[:notice] = '<%= class_name %> was successfully created.'
- format.html { redirect_to(@<%= file_name %>) }
+ format.html { redirect_to(@<%= file_name %>, :notice => '<%= class_name %> was successfully created.') }
format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }
else
format.html { render :action => "new" }
@@ -63,8 +62,7 @@ class <%= controller_class_name %>Controller < ApplicationController
respond_to do |format|
if @<%= orm_instance.update_attributes("params[:#{file_name}]") %>
- flash[:notice] = '<%= class_name %> was successfully updated.'
- format.html { redirect_to(@<%= file_name %>) }
+ format.html { redirect_to(@<%= file_name %>, :notice => '<%= class_name %> was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }