Skip to content

Commit 8931db9

Browse files
author
Stefano Verna
committed
Hide remove if image does not exist
1 parent 9c7cbf9 commit 8931db9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/formtastic/inputs/dragonfly_input.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ def fragment_url_html
8484
end
8585

8686
def fragment_remove_html
87-
template.content_tag(:label, for: fragment_id(:remove)) do
88-
builder.check_box("remove_#{method}") <<
89-
" ".html_safe <<
90-
I18n.t("dragonfly.remove")
87+
if object.send("#{method}_uid")
88+
template.content_tag(:label, for: fragment_id(:remove)) do
89+
builder.check_box("remove_#{method}") <<
90+
" ".html_safe <<
91+
I18n.t("dragonfly.remove")
92+
end
9193
end
9294
end
9395

0 commit comments

Comments
 (0)