This commit is contained in:
Myat Zin Wai Maw
2020-03-06 11:31:11 +06:30
parent 926c12d90d
commit 03fe9e43f2
2 changed files with 4 additions and 3 deletions

View File

@@ -1,7 +1,9 @@
class Api::DisplayImagesController < Api::ApiController
skip_before_action :authenticate
skip_before_action :set_current_tenant_by_subdomain_or_name, only: [:display_image]
def display_image
display_image = DisplayImage.where("shop_code",params[:shop_code]).last
display_image = DisplayImage.where("shop_code=?",params[:shop_code]).last
unless display_image.nil?
image = Base64.decode64(display_image.image.gsub(/\Adata:image\/jpeg;base64\,/, ''))
send_data image,:filename=>"shop.jpeg",:type=> "image/jpeg", :disposition => 'inline'