effective_bootstrap 1.15.5 → 1.15.6
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 +4 -4
- data/app/models/effective/table_builder.rb +11 -3
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cd2eede1a173ecbaaad8b73be59e3797c9712f934ce632af425383782ef0db8
|
4
|
+
data.tar.gz: 31585f4657f8dabb81ed0f0b00adc54922a1648831a2c13d03f93d5c03981c01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fce3aba0d09b7b423fc02910bf7e95f710663cf239bb2d78eaf76ef8768ab26f45d95a6dd9e8c8b01c5ddfaaaa4e934f8f36b535249690dd8d33cf1c83d6a74
|
7
|
+
data.tar.gz: '096fcdccb7fd896bee414dd23b2a7a8a166f9466f6e46f0e7e1bf17ef6557908f29f5fefb8bccc488b3f93b185a2a35d2eaec57d59ad481123e67e2fe7511395'
|
@@ -237,10 +237,18 @@ module Effective
|
|
237
237
|
end
|
238
238
|
|
239
239
|
def fields_for(name, object, options = {}, &block)
|
240
|
-
value(name)
|
241
|
-
|
240
|
+
values = value(name)
|
241
|
+
|
242
|
+
if values.respond_to?(:each_with_index)
|
243
|
+
values.each_with_index do |object, index|
|
244
|
+
builder = TableBuilder.new(object, template, options.reverse_merge(prefix: human_attribute_name(name).singularize + " ##{index+1}"))
|
245
|
+
builder.render(&block)
|
246
|
+
builder.rows.each { |child, content| rows["#{name}_#{child}_#{index}".to_sym] = content }
|
247
|
+
end
|
248
|
+
else
|
249
|
+
builder = TableBuilder.new(object, template, options.merge(prefix: human_attribute_name(name)))
|
242
250
|
builder.render(&block)
|
243
|
-
builder.rows.each { |child, content| rows["#{name}_#{child}
|
251
|
+
builder.rows.each { |child, content| rows["#{name}_#{child}".to_sym] = content }
|
244
252
|
end
|
245
253
|
end
|
246
254
|
alias_method :effective_fields_for, :fields_for
|