Module: Undercarriage::Controllers::Restful::Actions::UpdateConcern
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/undercarriage/controllers/restful/actions/update_concern.rb
Overview
Update restful action
Instance Method Summary collapse
-
#update ⇒ Object
Update action.
Instance Method Details
#update ⇒ Object
Update action
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/undercarriage/controllers/restful/actions/update_concern.rb', line 41 def update nested_resource_pre_build respond_to do |format| if @update_resource.update(update_resource_params) after_update_action format.html do flash[flash_status_type] = redirect_to location_after_update end format.json { render :show, status: :ok, location: location_after_update } else nested_resource_build format.html { render :edit, status: unprocessable_status } format.json { render json: @update_resource.errors, status: unprocessable_status } end end end |