Class: Editables::FieldsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/editables/fields_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/editables/fields_controller.rb', line 6

def update
  puts("in engine's controller")
  respond_to do |format|
    @field = Editables::Field.find(params[:id])
    if @field.update(editable_fields_params)
      # this should be changed
      if @field.image?
        puts("in fields.image")
        format.js
      else
        format.json { render json: {}, status: 200 }
      end
    end
  end
end