fga-eps-mds/2018.2-IndicaAi

View on GitHub
indicaAi/app/controllers/local_images_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
# Local Images Controller
class LocalImagesController < ApplicationController
  def receive_image
    local = Local.find(params[:id])
    return response_success('ERROR', 404) unless local.present?
    images = params[:image]
    images.each do |image|
      LocalImage.create(image: image, local_id: params[:id])
    end
    response_success('SUCCESS', 'Images saved', 200)
  end
end