Class: Cmsify::TextController

Inherits:
ApplicationController show all
Defined in:
app/controllers/cmsify/text_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/cmsify/text_controller.rb', line 5

def update
  if new_content = params[:content]
    if @object.update_attribute(params[:field], new_content)
      render json: @object
    else
      render json: @object.errors.full_messages, status: :unprocessable_entity
    end
  else
    head :bad_request
  end
end