simple_form_attachments 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1540e6d1e827ffdfacb5bf1fabb16add5326a15a
|
4
|
+
data.tar.gz: be5daa41dee23d745418119e798407f4e88e7c5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e57492026a7dc0e6bb79051ea58d642f77a4be62c5e5fb14477b812f05c3cb7d09b0f3e2961664008b6cf26eac1df906bed84b38516d9e716c6aafc032575b8
|
7
|
+
data.tar.gz: d7081f1fb537c5be4c22165dd5671478d5e7b24617f7c200e71bed50aa1eee7dc36052c404d214ef720cf20e8172e5b775e338ec784222623aa71acd3a0df238
|
data/Gemfile.lock
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
- form = ActionView::Helpers::FormBuilder.new(parent_class.
|
1
|
+
- form = ActionView::Helpers::FormBuilder.new(parent_class.model_name.param_key, parent, self, {})
|
2
2
|
|
3
3
|
= form.simple_fields_for attachment_relation[:name].to_sym, attachment, { child_index: child_index } do |fields|
|
4
4
|
- partial_locals = { attachment: attachment, form: form, fields: fields, multiple: multiple, relation_key: attachment_relation[:key] }
|
@@ -75,7 +75,9 @@ module SimpleFormAttachments
|
|
75
75
|
@builder.object_name
|
76
76
|
end
|
77
77
|
|
78
|
+
# FIXME: this should be inferred also from the :as options!!
|
78
79
|
def parent_class
|
80
|
+
return @builder.object.model.class.name if @builder.object.class.name.to_s =~ /decorator\z/i
|
79
81
|
@builder.object.class.name
|
80
82
|
end
|
81
83
|
|
@@ -206,7 +208,7 @@ module SimpleFormAttachments
|
|
206
208
|
table_classes << 'sortable' if sortable?
|
207
209
|
template.content_tag :table, class: table_classes do
|
208
210
|
@builder.simple_fields_for attribute_name do |attachment_fields|
|
209
|
-
template.render partial: attachment_fields.object, format: :html, layout: 'layouts/simple_form_attachments/attachment_layout',
|
211
|
+
template.render partial: attachment_fields.object.to_partial_path, format: :html, layout: 'layouts/simple_form_attachments/attachment_layout',
|
210
212
|
locals: {
|
211
213
|
attachment: attachment_fields.object,
|
212
214
|
fields: attachment_fields,
|
data/test/dummy/Gemfile.lock
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_form_attachments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Celizna
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|