diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-11-26 04:42:13 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-11-26 04:42:13 +0000 |
commit | 2d1169ad16029eb6fbae3b457d7dc2135b216d87 (patch) | |
tree | f4cd6ac0a597ef76cf1f0fff992fd72e03ce7c6f | |
parent | ba1db2de63b022b53cc2569fc89a6617824b0415 (diff) | |
download | rails-2d1169ad16029eb6fbae3b457d7dc2135b216d87.tar.gz rails-2d1169ad16029eb6fbae3b457d7dc2135b216d87.tar.bz2 rails-2d1169ad16029eb6fbae3b457d7dc2135b216d87.zip |
redirect_to is the one place where _url should be used, not _path [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5633 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb index 5f2fcde744..4ca12d622f 100644 --- a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb +++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb @@ -39,8 +39,8 @@ class <%= controller_class_name %>Controller < ApplicationController respond_to do |format| if @<%= file_name %>.save flash[:notice] = '<%= class_name %> was successfully created.' - format.html { redirect_to <%= file_name %>_path(@<%= file_name %>) } - format.xml { head :created, :location => <%= file_name %>_path(@<%= file_name %>) } + format.html { redirect_to <%= file_name %>_url(@<%= file_name %>) } + format.xml { head :created, :location => <%= file_name %>_url(@<%= file_name %>) } else format.html { render :action => "new" } format.xml { render :xml => @<%= file_name %>.errors.to_xml } @@ -56,7 +56,7 @@ class <%= controller_class_name %>Controller < ApplicationController respond_to do |format| if @<%= file_name %>.update_attributes(params[:<%= file_name %>]) flash[:notice] = '<%= class_name %> was successfully updated.' - format.html { redirect_to <%= file_name %>_path(@<%= file_name %>) } + format.html { redirect_to <%= file_name %>_url(@<%= file_name %>) } format.xml { head :ok } else format.html { render :action => "edit" } @@ -72,7 +72,7 @@ class <%= controller_class_name %>Controller < ApplicationController @<%= file_name %>.destroy respond_to do |format| - format.html { redirect_to <%= table_name %>_path } + format.html { redirect_to <%= table_name %>_url } format.xml { head :ok } end end |