rao-view_helper 0.0.48.pre → 0.0.50.pre
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,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cda3179ece4ff4b78095ffc53a8ad62f9e4ec505b5a8e2113c017685acad147
|
4
|
+
data.tar.gz: e5b34a426ee843d7d65a8d4cede99348ac29b75769e5b6a0018c52ab458da017
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a992d639f8d9757e8e2dbcbf3a4f6d742e85c9d29627c2d57d4861179637c9ee795853d0f0307cede25bf4632e6f9c6cf07e3800ecb1880163df4d63694b6949
|
7
|
+
data.tar.gz: 9d7f496c3c2499835a3684f9159e3f4632393dfa42b6959da7bd4f9038c5837b7abb1d702be2ecf6639e4f4bbaebe3012106f52038e54aed9f57ccb777e6b7bc
|
@@ -6,8 +6,8 @@ module Rao
|
|
6
6
|
module ClassMethods
|
7
7
|
def view_helper(klass, options = {})
|
8
8
|
method_name = options.delete(:as) || klass.name.underscore.gsub('/', '_')
|
9
|
-
define_method method_name do |context|
|
10
|
-
klass.new(context)
|
9
|
+
define_method method_name do |context, options = {}|
|
10
|
+
klass.new(context, options)
|
11
11
|
end
|
12
12
|
helper_method method_name
|
13
13
|
end
|
@@ -19,8 +19,11 @@ module Rao
|
|
19
19
|
# => "4.52 ct/kWh"
|
20
20
|
#
|
21
21
|
class Base
|
22
|
-
|
22
|
+
attr_reader :options
|
23
|
+
|
24
|
+
def initialize(context, options = {})
|
23
25
|
@context = context
|
26
|
+
@options = options
|
24
27
|
end
|
25
28
|
|
26
29
|
private
|
@@ -30,7 +33,7 @@ module Rao
|
|
30
33
|
end
|
31
34
|
|
32
35
|
def render(locals = {})
|
33
|
-
c.render partial: "/#{self.class.name.underscore}/#{caller_locations(1,1)[0].label}", locals: locals
|
36
|
+
c.render partial: "/#{self.class.name.underscore}/#{caller_locations(1,1)[0].label}", locals: locals.reverse_merge(view_helper: self)
|
34
37
|
end
|
35
38
|
|
36
39
|
# You can use scoped translations by using the dot notation.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rao-view_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.50.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: 1.3.1
|
148
148
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.4.20
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: View Helper Objects for Ruby on Rails.
|