inline_forms 3.0.32 → 3.0.34
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,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWE0ZTA0YTYxM2RhMmMzNzM4M2I2OWViNTBkZWM1MTc1NDFmYTlhNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGQ4OTNhODJiNmJlNDJhZDkyOGUwZjA3YjUwZTA5ZDczNjE5ZjQ1Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWM2NmQ2NDNmMzkzMzIyMWE4NjM5NWQ1MTI5NjY2ZWJlOTc0NzA3YjlhYmE5
|
10
|
+
ZjZmNzc1MTEyOTY4OGYyOTc5YWM1N2E3YjU1OTgwZjg0ZGVlYzVlMDZlYjM3
|
11
|
+
N2U3OThhMDk3YjM1ZjMzYTliNzJiY2FjOTQyZmJhYWQ3OGU5Mjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjRmMGNhNjk5NjViMzhkMmM0NmUwZGVhMWJjMGNmNjJmNGU0NDViM2MxOWM1
|
14
|
+
ZDM4ZjFlOWZmOTdlZjkyOTQyNTJjMmExNzg5ZTNjMzhlMjU3ZjM4NmJjZDY4
|
15
|
+
NmNjNTdhOGFlY2VkZjkzYjVkNmY1ZjE3MDEwYTJmM2M4YmJmMDI=
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
InlineForms::SPECIAL_COLUMN_TYPES[:dropdown]=:belongs_to
|
3
|
+
|
4
|
+
# dropdown
|
5
|
+
def chicas_dropdown_with_family_members_show(object, attribute)
|
6
|
+
attribute_value = object.send(attribute)._dropdown_presentation rescue "<i class='fi-plus'></i>".html_safe
|
7
|
+
link_to_inline_edit object, attribute, attribute_value
|
8
|
+
end
|
9
|
+
|
10
|
+
def chicas_dropdown_with_family_members_edit(object, attribute)
|
11
|
+
o = object.send(attribute) # the client
|
12
|
+
values = o.family.clients
|
13
|
+
values.sort_by! &:_dropdown_presentation
|
14
|
+
# the leading underscore is to avoid name conflicts, like 'email' and 'email_type' will result in 'email' and 'email[email_type_id]' in the form!
|
15
|
+
collection_select( ('_' + object.class.to_s.underscore).to_sym, attribute.to_s.foreign_key.to_sym, values, 'id', '_dropdown_presentation', :selected => object.send(attribute).id)
|
16
|
+
end
|
17
|
+
|
18
|
+
def chicas_dropdown_with_family_members_update(object, attribute)
|
19
|
+
foreign_key = object.class.reflect_on_association(attribute.to_sym).options[:foreign_key] || attribute.to_s.foreign_key.to_sym
|
20
|
+
old_path = File.dirname(object.image.path)
|
21
|
+
object[foreign_key] = params[('_' + object.class.to_s.underscore).to_sym][attribute.to_s.foreign_key.to_sym]
|
22
|
+
if object.save
|
23
|
+
# move to new location
|
24
|
+
new_path = File.join(Rails.root, "public/uploads/client/photo/#{object.client_id}")
|
25
|
+
system "mkdir -vp #{new_path}"
|
26
|
+
system "mv -v #{old_path} #{new_path}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
data/lib/inline_forms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ace Suares
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rvm
|
@@ -186,6 +186,7 @@ files:
|
|
186
186
|
- lib/app/controllers/inline_forms_controller.rb
|
187
187
|
- lib/app/helpers/form_elements/check_box.rb
|
188
188
|
- lib/app/helpers/form_elements/check_list.rb
|
189
|
+
- lib/app/helpers/form_elements/chicas_dropdown_with_family_members.rb
|
189
190
|
- lib/app/helpers/form_elements/chicas_family_photo_list.rb
|
190
191
|
- lib/app/helpers/form_elements/chicas_photo_list.rb
|
191
192
|
- lib/app/helpers/form_elements/date.rb
|