Class: HeraCms::TextsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/hera_cms/texts_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



6
7
8
9
10
11
12
13
14
# File 'app/controllers/hera_cms/texts_controller.rb', line 6

def update
  @text = HeraCms::Text.find(params[:id])

  if @text.update(text_params)
    render json: { redirect: URI(request.referer).path }, status: 200
  else
    render json: { errors: @text.errors.full_messages }, status: 422
  end
end