FEATURE: upload images and fonts in themes via hijack
This commit is contained in:
parent
5e90abfaea
commit
433ef4513b
|
@ -13,6 +13,8 @@ class Admin::ThemesController < Admin::AdminController
|
||||||
|
|
||||||
def upload_asset
|
def upload_asset
|
||||||
path = params[:file].path
|
path = params[:file].path
|
||||||
|
|
||||||
|
hijack do
|
||||||
File.open(path) do |file|
|
File.open(path) do |file|
|
||||||
filename = params[:file]&.original_filename || File.basename(path)
|
filename = params[:file]&.original_filename || File.basename(path)
|
||||||
upload = UploadCreator.new(file, filename, for_theme: true).create_for(current_user.id)
|
upload = UploadCreator.new(file, filename, for_theme: true).create_for(current_user.id)
|
||||||
|
@ -23,6 +25,7 @@ class Admin::ThemesController < Admin::AdminController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def import
|
def import
|
||||||
@theme = nil
|
@theme = nil
|
||||||
|
|
Loading…
Reference in New Issue