effective_resources 1.7.3 → 1.7.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 321d1bd446ce934af73f92967e26577e09f16de314d0c0c780630901ccc23823
|
4
|
+
data.tar.gz: f65a37ad4e83d73e6d3da2ac2bf3a0a1588b7ca86e425ddb2d901ba9e9dfd571
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e828b71738b3f48d9819fbffcabf1e8a94a44ae0e410069a0a7f1b64751cdb02fb23ce75dd0ad7ffc687ce6c0955112c4da1f9c864cc62256832fd308938b936
|
7
|
+
data.tar.gz: d2be424f57532b120b7a1e465e158592a2f5cc20ba2c8b6ac21dba864d9f8c844143d9e229507b1ad9e7792285065665ec57c87eedcfaab760e40fedf02ec095
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Effective
|
2
4
|
module CrudController
|
3
5
|
module Respond
|
@@ -94,7 +96,10 @@ module Effective
|
|
94
96
|
end
|
95
97
|
|
96
98
|
def template_present?(action)
|
97
|
-
lookup_context.template_exists?("#{action}.#{request.format.symbol.to_s.sub('json', 'js').presence || 'html'}", _prefixes)
|
99
|
+
#lookup_context.template_exists?("#{action}.#{request.format.symbol.to_s.sub('json', 'js').presence || 'html'}", _prefixes)
|
100
|
+
|
101
|
+
formats = [request.format.symbol.to_s.sub('json', 'js').presence || 'html']
|
102
|
+
lookup_context.template_exists?(action, _prefixes, formats: formats)
|
98
103
|
end
|
99
104
|
|
100
105
|
end
|
@@ -107,15 +107,16 @@ module EffectiveResourcesHelper
|
|
107
107
|
|
108
108
|
# Select Partial
|
109
109
|
partial = if partial.kind_of?(Symbol)
|
110
|
-
"effective/resource/actions_#{partial}
|
110
|
+
"effective/resource/actions_#{partial}"
|
111
111
|
else
|
112
|
-
|
112
|
+
partial.presence || 'effective/resource/actions'
|
113
113
|
end
|
114
114
|
|
115
115
|
# Assign Locals
|
116
116
|
locals = {
|
117
117
|
resource: resource,
|
118
118
|
effective_resource: effective_resource,
|
119
|
+
formats: [:html],
|
119
120
|
format_block: (block if block_given?),
|
120
121
|
namespace: namespace,
|
121
122
|
actions: actions,
|
@@ -123,7 +124,14 @@ module EffectiveResourcesHelper
|
|
123
124
|
}.compact.merge(locals)
|
124
125
|
|
125
126
|
if resource.kind_of?(Array)
|
126
|
-
render(
|
127
|
+
render(
|
128
|
+
partial: partial,
|
129
|
+
formats: [:html],
|
130
|
+
collection: resource,
|
131
|
+
as: :resource,
|
132
|
+
locals: locals.except(:resource),
|
133
|
+
spacer_template: spacer_template
|
134
|
+
)
|
127
135
|
else
|
128
136
|
render(partial, locals)
|
129
137
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|