effective_resources 1.8.5 → 1.8.6

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: 29481500627bdb2e83a1f66d58dde1c9d74aecc2e8902b2bb2afa82b0a70ad46
4
- data.tar.gz: e46866b50672f2e2fa928caa226d663eb630f292d3a2b10c3de026cf323b3d67
3
+ metadata.gz: 3054f246623c2920a43e74b98bdb52aa03501ca936da01036523ac76e6f35049
4
+ data.tar.gz: 2121fdfa7914e4b0c4c516a26d030f6ff3c1bda0d60ff54a5f683fe0c4280c51
5
5
  SHA512:
6
- metadata.gz: fd7cfc021a37f0e1b4381b7d9a6b3ff1515c9368ff3b4fbc072573ebdc89a6e0df0b59f01fa1392fafe00d1993ff1115cdabd1081315172dc84db711786cc36f
7
- data.tar.gz: b352c4e02f16afae95201ad937ec14a746a73c116a6a9149052a3c239c9160229f9932ffbfb9a5e66a8c25782f38a29146e5b1f5b0bb4df1616c4a5201cc0da4
6
+ metadata.gz: c714c8640357cbb5c52aeca16a5cef0a6e0caf9eafe1a54cccf8c9aee79f27afb65ae022a8512c4297c379b96b9dc9c98275345709a24591aa8b1544051d64fc
7
+ data.tar.gz: be065c497d1b2b664b9d82dedf8fa2e3fd77bc25f89b06d51a1841ce9069fdd41e933d681cf11a66a2f76d2846c09b9f1c2353e75d88c69d48d8df0cbdacde27
@@ -148,6 +148,7 @@ module EffectiveResourcesHelper
148
148
  effective_resource = (atts.delete(:effective_resource) || find_effective_resource)
149
149
 
150
150
  action = atts.delete(:action)
151
+ safe = atts.delete(:safe)
151
152
  atts = { :namespace => (effective_resource.namespace.to_sym if effective_resource.namespace), effective_resource.name.to_sym => resource }.compact.merge(atts)
152
153
 
153
154
  if lookup_context.template_exists?("form_#{action}", controller._prefixes, :partial)
@@ -168,7 +169,10 @@ module EffectiveResourcesHelper
168
169
  end
169
170
  end
170
171
 
171
- render('form', atts) # Will raise the regular error
172
+ # Will raise the regular error
173
+ return ''.html_safe if safe
174
+
175
+ render('form', atts)
172
176
  end
173
177
 
174
178
  # Similar to render_resource_form
@@ -182,6 +186,7 @@ module EffectiveResourcesHelper
182
186
  effective_resource = (atts.delete(:effective_resource) || find_effective_resource)
183
187
 
184
188
  action = atts.delete(:action)
189
+ safe = atts.delete(:safe)
185
190
  atts = { :namespace => (effective_resource.namespace.to_sym if effective_resource.namespace), effective_resource.name.to_sym => resource }.compact.merge(atts)
186
191
 
187
192
  if lookup_context.template_exists?(effective_resource.name, controller._prefixes, :partial)
@@ -194,7 +199,10 @@ module EffectiveResourcesHelper
194
199
  end
195
200
  end
196
201
 
197
- render(resource, atts) # Will raise the regular error
202
+ # Will raise the regular error
203
+ return ''.html_safe if safe
204
+
205
+ render(resource, atts)
198
206
  end
199
207
  alias_method :render_resource, :render_resource_partial
200
208
 
@@ -1,7 +1,7 @@
1
1
  <% resource = (@_effective_resource || Effective::Resource.new(controller_path)) %>
2
2
  <% @resource = instance_variable_get('@' + resource.name) if resource.name %>
3
3
 
4
- EffectiveForm.remote_form_payload = "<%= j render_resource_form(@resource, action: action) %>";
4
+ EffectiveForm.remote_form_payload = "<%= j render_resource_form(@resource, action: action, safe: true) %>";
5
5
  EffectiveForm.remote_form_commit = "<%= params[:commit] %>";
6
6
  EffectiveForm.remote_form_flash = <%= raw flash.to_json %>;
7
7
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '1.8.5'.freeze
2
+ VERSION = '1.8.6'.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.8.5
4
+ version: 1.8.6
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-03-08 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails