Class: Cmsify::TextController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Cmsify::TextController
- Defined in:
- app/controllers/cmsify/text_controller.rb
Instance Method Summary collapse
Instance Method Details
#update ⇒ Object
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., status: :unprocessable_entity end else head :bad_request end end |