simple_form_extension 1.4.9 → 1.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c89c395024da3cde1e87ccc95adfb1678cb52882
|
|
4
|
+
data.tar.gz: 43534c24e64bd5bc4b96864bcbfdcf5036eaf3dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aecd735784ba30acd94a755bbc160d8a9ff63c3af128ce548c03cef1559c87355193bcef5095062c0a41575753bc78e8e9f2ef9d0cc2d4225d7c6298b766885b
|
|
7
|
+
data.tar.gz: 1a3dba52ccb7200a5b732b8e84358ca6f6971d19b73dcd55a192b5789cc9999638ec1122e6293e3d92ed4cbed0541e84421a500c98c41cc0341164b0e23fd196
|
|
@@ -48,7 +48,8 @@ module SimpleFormExtension
|
|
|
48
48
|
content_tag(:a, class: 'btn btn-default ', href: file_url, target: '_blank', data: { toggle: 'existing-file' }) do
|
|
49
49
|
content_tag(:i, '', class: 'fa fa-file') +
|
|
50
50
|
" ".html_safe +
|
|
51
|
-
|
|
51
|
+
|
|
52
|
+
existing_file_name
|
|
52
53
|
end +
|
|
53
54
|
|
|
54
55
|
remove_file_button
|
|
@@ -56,6 +57,16 @@ module SimpleFormExtension
|
|
|
56
57
|
end
|
|
57
58
|
end
|
|
58
59
|
|
|
60
|
+
def existing_file_name
|
|
61
|
+
return unless file_exists?
|
|
62
|
+
|
|
63
|
+
if object.try(:"#{ attribute_name }?")
|
|
64
|
+
object.send(:"#{ attribute_name }_file_name").html_safe
|
|
65
|
+
elsif (attachment = object.try(attribute_name)).try(:attached?)
|
|
66
|
+
attachment.filename.to_s
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
59
70
|
def remove_file_button
|
|
60
71
|
return unless object.respond_to?(:"#{ remove_attachment_method }=")
|
|
61
72
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple_form_extension
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Glyph-fr
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-04-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|