Method: AnswersController#update
- Defined in:
- app/controllers/answers_controller.rb
#update ⇒ Object
PUT /answers/1 PUT /answers/1.json
113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'app/controllers/answers_controller.rb', line 113 def update respond_to do |format| if @answer.update(answer_update_params) flash[:notice] = t('controller.successfully_updated', model: t('activerecord.models.answer')) format.html { redirect_to @answer } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @answer.errors, status: :unprocessable_entity } end end end |