Add multiple photo upload
This commit is contained in:
@@ -6,6 +6,10 @@ class Settings::MenusController < ApplicationController
|
||||
# GET /settings/menus.json
|
||||
def index
|
||||
@settings_menus = Menu.all.page(params[:page]).per(10)
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.csv { send_data Menu.to_csv }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /settings/menus/1
|
||||
|
||||
@@ -51,7 +51,11 @@ class Settings::ShopsController < ApplicationController
|
||||
if @settings_shop.update(shop_params)
|
||||
if params[:display_images].present?
|
||||
params[:display_images]['image'].each do |a|
|
||||
@display_image = @settings_shop.display_images.create!(:shop_id => @shop.id, :image => a)
|
||||
|
||||
aa = a.read
|
||||
base64_encoded = Base64.encode64(aa)
|
||||
byebug
|
||||
@display_image = @settings_shop.display_images.create!(:shop_id => @shop.id, :image => base64_encoded)
|
||||
end
|
||||
end
|
||||
format.html { redirect_to settings_shops_url, notice: 'Shop was successfully updated.' }
|
||||
|
||||
Reference in New Issue
Block a user