Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

redirect_to is the one place where _url should be used, not _path [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5633 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 691c439129d7d47b47fb4e73b85f8cec953fcedb 1 parent 8f3e81e
@dhh dhh authored
View
8 railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb
@@ -39,8 +39,8 @@ def create
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 @@ def update
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 @@ def destroy
@<%= 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
Please sign in to comment.
Something went wrong with that request. Please try again.