active-component 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_component/renderable.rb +3 -3
- data/lib/active_component/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbb5b87d66dd76ede2b38494bcf4c7312d061a7a
|
4
|
+
data.tar.gz: 379c7e842e21638d99ae5bafe19a1affb8850d1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8f6f43358828754a9578dc8bf25af4ec2a73c902d4493f5ef318216bb1c484294a9d67b707d8cfb260ac3562f6f3004da42a39abeb40a0758dc4ddb8278edbd
|
7
|
+
data.tar.gz: 058879ae9fc098a721a34b99caa2535cd1a9276ad6fc96e96e44fd8fdcafc7655490597fd59acc6a6c033bbecefee078d7d0c4f4e2d62baaaf00418b73fab787
|
@@ -19,7 +19,7 @@ module ActiveComponent
|
|
19
19
|
raise_errors(type, args) if type.nil? or args.nil?
|
20
20
|
|
21
21
|
unless args[:collection].present?
|
22
|
-
|
22
|
+
element(type, args)
|
23
23
|
else
|
24
24
|
collection(type, args[:collection], args[:as], args[:locals])
|
25
25
|
end
|
@@ -27,7 +27,7 @@ module ActiveComponent
|
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
-
def
|
30
|
+
def element(type, args)
|
31
31
|
resource = constantize("#{type.to_s}_component").new(args)
|
32
32
|
resource.render
|
33
33
|
end
|
@@ -40,7 +40,7 @@ module ActiveComponent
|
|
40
40
|
locals = locals || {}
|
41
41
|
|
42
42
|
html_string = collection.map do |item|
|
43
|
-
|
43
|
+
element(
|
44
44
|
type,
|
45
45
|
locals.merge(as => item)
|
46
46
|
)
|