effective_resources 1.7.3 → 1.7.4

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: a63a4abae27e2b70ac922d2f3eca07c701842b9ef2482677d200236f05a05dc8
4
- data.tar.gz: 136206e80f42d5c019f9113d46c3260d19115f7f40ef58f0064f74b57283167f
3
+ metadata.gz: 321d1bd446ce934af73f92967e26577e09f16de314d0c0c780630901ccc23823
4
+ data.tar.gz: f65a37ad4e83d73e6d3da2ac2bf3a0a1588b7ca86e425ddb2d901ba9e9dfd571
5
5
  SHA512:
6
- metadata.gz: 2b08dd74cfa1605c8dcf8e8082612b078ff20b93f9bfbb931f41b8d58ec2795f4a6ca0ed13f837860df4b3166c2069136ab26e0b19a46fa812af2293674bb56a
7
- data.tar.gz: a64adaf287722c737951827174f1074ad0580688540944551f406d66fb28dadf74ca7c845c57f008aea6036c355655674328c37c89cc90be36f40738753db436
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}.html"
110
+ "effective/resource/actions_#{partial}"
111
111
  else
112
- "#{partial.presence || 'effective/resource/actions'}.html"
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(partial: partial, collection: resource, as: :resource, locals: locals.except(:resource), spacer_template: spacer_template)
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '1.7.3'.freeze
2
+ VERSION = '1.7.4'.freeze
3
3
  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.3
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-02 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails