effective_resources 2.27.12 → 2.28.0
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: 4229845a5685455eaf623f5d8f6516735d3d414c76be408db9e86df50dc1c477
|
4
|
+
data.tar.gz: 5f0171e49a79cd0cdc7b1438f2c91ab6f52d99efa29a818636bf6593610832ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee066f39b9632ebb46cf77d47f96334c433360dadd9a60e41faffa30e1cc4dad249e5903faa67c7196cc0c8a8762b54cda94c02e218bda9cad36556015e0cb9e
|
7
|
+
data.tar.gz: 13cf2ff5ccb197c951ffedd77ed1cc3d96872a81327903072fd6a4ef852fed53f51587704d7928350ea8f6d7450301660ce51876172897843ad2d0012808ac56
|
@@ -255,5 +255,30 @@ module Effective
|
|
255
255
|
end
|
256
256
|
end
|
257
257
|
|
258
|
+
def nested_datatable_action(action = nil)
|
259
|
+
Rails.logger.info "Processed by Effective::CrudController#nested_datatable_action"
|
260
|
+
|
261
|
+
raise('expected a GET request') unless request.get?
|
262
|
+
raise('expected @datatable to be present') if @datatable.nil?
|
263
|
+
|
264
|
+
action ||= action_name
|
265
|
+
|
266
|
+
EffectiveResources.authorize!(self, :index, @datatable)
|
267
|
+
@page_title ||= @datatable.datatable_name
|
268
|
+
|
269
|
+
respond_to do |format|
|
270
|
+
format.html do
|
271
|
+
html_template = action if template_present?(action, format: :html)
|
272
|
+
render(html_template || 'index')
|
273
|
+
end
|
274
|
+
|
275
|
+
format.js do
|
276
|
+
html_template = [controller_path, action].join('/') if template_present?(action, format: :html)
|
277
|
+
template = template_present?(action) ? action : 'nested_datatable_action'
|
278
|
+
|
279
|
+
render(template, formats: :js, locals: { action: action, html_template: html_template })
|
280
|
+
end
|
281
|
+
end
|
282
|
+
end
|
258
283
|
end
|
259
284
|
end
|
@@ -57,9 +57,9 @@ module Effective
|
|
57
57
|
|
58
58
|
# If the method is named :status, and there is a Class::STATUSES
|
59
59
|
if ((klass || NilClass).const_defined?(name.pluralize.upcase) rescue false)
|
60
|
-
{ as: :select, collection: klass.const_get(name.pluralize.upcase) }
|
60
|
+
{ as: :select, collection: Array(klass.const_get(name.pluralize.upcase)) }
|
61
61
|
elsif ((klass || NilClass).const_defined?(name.singularize.upcase) rescue false)
|
62
|
-
{ as: :select, collection: klass.const_get(name.singularize.upcase) }
|
62
|
+
{ as: :select, collection: Array(klass.const_get(name.singularize.upcase)) }
|
63
63
|
else
|
64
64
|
{ as: :string }
|
65
65
|
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<% if local_assigns[:html_template].present? %>
|
2
|
+
EffectiveForm.remote_form_payload = "<%= j(render(template: local_assigns[:html_template], formats: :html)) %>";
|
3
|
+
<% else %>
|
4
|
+
EffectiveForm.remote_form_payload = "<%= j(render_datatable(@datatable, nested: true)) %>";
|
5
|
+
<% 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: 2.
|
4
|
+
version: 2.28.0
|
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: 2025-
|
11
|
+
date: 2025-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -267,6 +267,7 @@ files:
|
|
267
267
|
- app/views/application/edit.js.erb
|
268
268
|
- app/views/application/index.html.haml
|
269
269
|
- app/views/application/member_action.js.erb
|
270
|
+
- app/views/application/nested_datatable_action.js.erb
|
270
271
|
- app/views/application/new.html.haml
|
271
272
|
- app/views/application/new.js.erb
|
272
273
|
- app/views/application/show.html.haml
|