diff options
Diffstat (limited to 'actionpack/lib/action_controller/metal/responder.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/responder.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/actionpack/lib/action_controller/metal/responder.rb b/actionpack/lib/action_controller/metal/responder.rb index 1e8990495c..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 @@ -63,7 +63,7 @@ module ActionController #:nodoc: # # def create # @project = Project.find(params[:project_id]) - # @task = @project.comments.build(params[:task]) + # @task = @project.tasks.build(params[:task]) # flash[:notice] = 'Task was successfully created.' if @task.save # respond_with(@project, @task) # end @@ -90,9 +90,9 @@ module ActionController #:nodoc: # # def create # @project = Project.find(params[:project_id]) - # @task = @project.comments.build(params[:task]) + # @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, @@ -102,8 +102,8 @@ module ActionController #:nodoc: # # def create # @project = Project.find(params[:project_id]) - # @task = @project.comments.build(params[:task]) - # respond_with(@project, @task, :status => 201) do |format| + # @task = @project.tasks.build(params[:task]) + # 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) |