diff options
author | John Gallagher <john@synapticmishap.co.uk> | 2012-10-27 21:55:56 +0100 |
---|---|---|
committer | John Gallagher <john@synapticmishap.co.uk> | 2012-10-27 21:55:56 +0100 |
commit | 4edea9e82087f5a331a277ee4bf7b01256d11be0 (patch) | |
tree | 58164e6aa6ac19a644e590dc35d3ab98fc5a42ef /actionpack/lib/action_controller/metal/responder.rb | |
parent | c570ba70fe6ed53fd1ac5f30f0c9ba4cb7cd4796 (diff) | |
parent | 62f273b6501db72e3c902d947e6828dcab9c004a (diff) | |
download | rails-4edea9e82087f5a331a277ee4bf7b01256d11be0.tar.gz rails-4edea9e82087f5a331a277ee4bf7b01256d11be0.tar.bz2 rails-4edea9e82087f5a331a277ee4bf7b01256d11be0.zip |
Merge branch 'master' of https://github.com/lifo/docrails
Diffstat (limited to 'actionpack/lib/action_controller/metal/responder.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/responder.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/actionpack/lib/action_controller/metal/responder.rb b/actionpack/lib/action_controller/metal/responder.rb index 42a0959a58..891819968b 100644 --- a/actionpack/lib/action_controller/metal/responder.rb +++ b/actionpack/lib/action_controller/metal/responder.rb @@ -45,10 +45,10 @@ module ActionController #:nodoc: # if @user.save # flash[:notice] = 'User was successfully created.' # format.html { redirect_to(@user) } - # format.xml { render :xml => @user, :status => :created, :location => @user } + # format.xml { render xml: @user, status: :created, location: @user } # else - # format.html { render :action => "new" } - # format.xml { render :xml => @user.errors, :status => :unprocessable_entity } + # format.html { render action: "new" } + # format.xml { render xml: @user.errors, status: :unprocessable_entity } # end # end # end @@ -92,7 +92,7 @@ module ActionController #:nodoc: # @project = Project.find(params[:project_id]) # @task = @project.tasks.build(params[:task]) # flash[:notice] = 'Task was successfully created.' if @task.save - # respond_with(@project, @task, :status => 201) + # respond_with(@project, @task, status: 201) # end # # This will return status 201 if the task was saved successfully. If not, @@ -103,7 +103,7 @@ module ActionController #:nodoc: # def create # @project = Project.find(params[:project_id]) # @task = @project.tasks.build(params[:task]) - # respond_with(@project, @task, :status => 201) do |format| + # respond_with(@project, @task, status: 201) do |format| # if @task.save # flash[:notice] = 'Task was successfully created.' # else @@ -236,20 +236,20 @@ module ActionController #:nodoc: # Display is just a shortcut to render a resource with the current format. # - # display @user, :status => :ok + # display @user, status: :ok # # For XML requests it's equivalent to: # - # render :xml => @user, :status => :ok + # render xml: @user, status: :ok # # Options sent by the user are also used: # - # respond_with(@user, :status => :created) - # display(@user, :status => :ok) + # respond_with(@user, status: :created) + # display(@user, status: :ok) # # Results in: # - # render :xml => @user, :status => :created + # render xml: @user, status: :created # def display(resource, given_options={}) controller.render given_options.merge!(options).merge!(format => resource) |