This commit is contained in:
Ari Timonen 2020-04-07 00:33:09 +03:00
parent 848866f883
commit 0e9e1044e3
3 changed files with 4 additions and 4 deletions

View file

@ -6,7 +6,7 @@ class ImageUploader < CarrierWave::Uploader::Base
storage :file
def store_dir
"images"
File.join("local", "maps")
end
def filename

View file

@ -16,8 +16,8 @@
<div class="fields horizontal">
<%= f.label :picture %>
<div class="inputs">
<% if @map.picture.length > 0 %>
<%= image_tag @map.picture %><br>
<% if @map.picture&.file&.exists? %>
<%= image_tag @map.picture.url %><br>
<% end %>
<%= f.file_field :picture %>
</div>

View file

@ -5,7 +5,7 @@
<% if @map.picture.length > 0 %>
<div class="preview">
<%= image_tag @map.picture %>
<%= image_tag @map.picture.url %>
</div>
<% end %>