view_component 2.22.0 → 2.22.1
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.
Potentially problematic release.
This version of view_component might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/view_component/base.rb +6 -2
- data/lib/view_component/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 443af024d4cbb4251192a8d21eb95d40ad011aaac81a6572acfade86fd237f2d
|
4
|
+
data.tar.gz: bf7768afd857d6ed5580105a947fb5329615b01513f748c7856e33cd1cc43af9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f04ddd1e8c82e8b7bf586eb249a0c8dcbdf6a3b214c9b26fabf988d2c1696f78cd684654d8a7ffc7d86bf8e282204a8643784bc1c8b0153338b688b8cfe252f
|
7
|
+
data.tar.gz: 4b7d2fa52955349650500493c90882b05809b74fb447d590ea96aea9781198233dd091db7db1b4a643c4185830f9ff10b8e5a44dd2c48ccb3c9f8c42ad0525ea
|
data/CHANGELOG.md
CHANGED
data/lib/view_component/base.rb
CHANGED
@@ -102,7 +102,11 @@ module ViewComponent
|
|
102
102
|
# If trying to render a partial or template inside a component,
|
103
103
|
# pass the render call to the parent view_context.
|
104
104
|
def render(options = {}, args = {}, &block)
|
105
|
-
|
105
|
+
if options.is_a?(String) || (options.is_a?(Hash) && options.has_key?(:partial))
|
106
|
+
view_context.render(options, args, &block)
|
107
|
+
else
|
108
|
+
super
|
109
|
+
end
|
106
110
|
end
|
107
111
|
|
108
112
|
def controller
|
@@ -113,7 +117,7 @@ module ViewComponent
|
|
113
117
|
# Provides a proxy to access helper methods from the context of the current controller
|
114
118
|
def helpers
|
115
119
|
raise ViewContextCalledBeforeRenderError, "`helpers` can only be called at render time." if view_context.nil?
|
116
|
-
@helpers ||= view_context
|
120
|
+
@helpers ||= controller.view_context
|
117
121
|
end
|
118
122
|
|
119
123
|
# Exposes .virutal_path as an instance method
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.22.
|
4
|
+
version: 2.22.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|