Multiple image upload finished
This commit is contained in:
@@ -47,15 +47,13 @@ class Settings::ShopsController < ApplicationController
|
||||
# PATCH/PUT /settings/shops/1
|
||||
# PATCH/PUT /settings/shops/1.json
|
||||
def update
|
||||
|
||||
respond_to do |format|
|
||||
if @settings_shop.update(shop_params)
|
||||
if params[:display_images].present?
|
||||
params[:display_images]['image'].each do |a|
|
||||
|
||||
aa = a.read
|
||||
base64_encoded = Base64.encode64(aa)
|
||||
byebug
|
||||
@display_image = @settings_shop.display_images.create!(:shop_id => @shop.id, :image => base64_encoded)
|
||||
params[:display_images][:image].each do |a|
|
||||
@aa = Base64.encode64(a.read)
|
||||
@display_image = @settings_shop.display_images.create!(:shop_id => @shop.id, :image => "data:image/jpeg;base64,"+@aa)
|
||||
end
|
||||
end
|
||||
format.html { redirect_to settings_shops_url, notice: 'Shop was successfully updated.' }
|
||||
|
||||
Reference in New Issue
Block a user