Class: EditableAreasController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- EditableAreasController
- Defined in:
- app/controllers/editable_areas_controller.rb
Instance Method Summary collapse
-
#update ⇒ Object
PATCH/PUT /editable_area/1.json.
Instance Method Details
#update ⇒ Object
PATCH/PUT /editable_area/1.json
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/editable_areas_controller.rb', line 4 def update @editable_area = EditableArea.find(params[:id]) :update, @editable_area if defined? CanCan::Ability respond_to do |format| if @editable_area.update_attributes(editable_area_params) format.html { redirect_to request.referrer.split('?').first, notice: 'Editable area was successfully updated.' } format.json { head :no_content } else format.html { redirect_to request.referrer, notice: @editable_area.errors..join(', ') } format.json { render json: @editable_area.errors, status: :unprocessable_entity } end end end |