inplace_editing 0.3.11 → 0.3.12
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: ef4b00fc7c12fd5758825de3ff62ad637c43fe64
|
4
|
+
data.tar.gz: e048baca027d44c08a2ef1efc31580f2b1e8facd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc412e20baabc0f954552007be03e071bb09fb1634dcdfeaffdb15fb1a66de7950e1d3ec41abdea58b8014c18d2bffc1bbd69cfb8b933d1b8d837990a888b1ec
|
7
|
+
data.tar.gz: 728a84f25760397fa8e8cb12808826d49831d70ea66f4775398770dafed3aa7de0e5e589f4bf15de005a644ff9e16f9b283ce6bfc80cea3aff988e508a5f30c1
|
@@ -25,6 +25,12 @@ module InplaceEditingHelper
|
|
25
25
|
|
26
26
|
def image_editor(localized_object, property, place_holder = nil, default_value = nil, title = "", css_class="")
|
27
27
|
locals = editor_locals(localized_object, property, place_holder, default_value)
|
28
|
+
image_src = default_value
|
29
|
+
if localized_object[property]
|
30
|
+
image_src = localized_object.public_send(property)
|
31
|
+
image_src = image_src.url if image.respond_to?(:url)
|
32
|
+
end
|
33
|
+
locals[:image_src] = image_src
|
28
34
|
locals[:title] = title
|
29
35
|
locals[:class] = css_class
|
30
36
|
render partial: 'inplace_editing/image', :locals => locals
|
@@ -1,4 +1,3 @@
|
|
1
|
-
- image_src = localized_object[property] ? localized_object.send(property.to_s + '_url') : local_assigns[:default_value]
|
2
1
|
= simple_form_for(localized_object, html: { class: 'inplace_editor inplace_editor_image', :multipart => true, novalidate: true }, :format => :json, :remote => true, authenticity_token: true) do |f|
|
3
2
|
= f.input_field property, as: :file, label: "Trocar Imagem", style: 'display:none'
|
4
3
|
= f.input property.to_s + "_cache", as: :hidden
|