Class: PhrasingImagesController

Inherits:
ActionController::Base
  • Object
show all
Includes:
PhrasingHelper
Defined in:
app/controllers/phrasing_images_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/phrasing_images_controller.rb', line 4

def update
  phrasing_image = PhrasingImage.find(params[:id])
  phrasing_image.image = params[:phrasing_image][:image]

  if phrasing_image.save
    render json: phrasing_image, status: 200
  else
    render json: { errors: phrasing_image.errors.values.first }, status: 403
  end
end