Store web app icons with proper folder paths
This commit is contained in:
parent
0a69603643
commit
bec827acb1
@ -35,10 +35,11 @@ module AppCatalogManager
|
|||||||
|
|
||||||
def attach_remote_image(attachment_name, icon)
|
def attach_remote_image(attachment_name, icon)
|
||||||
download_url = "#{@app.url}/#{icon["src"].gsub(/^\//,'')}"
|
download_url = "#{@app.url}/#{icon["src"].gsub(/^\//,'')}"
|
||||||
filename = "web_apps/#{@app.id}/icons/#{attachment_name}.png"
|
filename = "#{attachment_name}.png"
|
||||||
|
key = "web_apps/#{@app.id}/icons/#{attachment_name}.png"
|
||||||
|
|
||||||
tempfile = Down.download(download_url)
|
tempfile = Down.download(download_url)
|
||||||
@app.send(attachment_name).attach(io: tempfile, filename: filename)
|
@app.send(attachment_name).attach(key: key, io: tempfile, filename: filename)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user