effective_resources 0.8.5 → 0.8.6
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf2388cda759dd479d527951e8d9ee29e95ccfd2
|
4
|
+
data.tar.gz: 4281eedf715d8d5ef2cfe6ea91cf5dbe686dfd1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89dd285d4e1179cad76c591719e8f48ca0faf6a2998cead46cfc59234e122f09767129d773da66ff8ce39d98272217eab0b892fe100a2fdb4f06426ad5e6b4f2
|
7
|
+
data.tar.gz: 0c0a5fd8aa744d0630af9686793ce190da98906d37455e5bc1bf8b6ea375e8b04ac0020061b21431d0f986c48cdc6aaa9275e9d18e78df286e55610cdf998b8d
|
@@ -204,7 +204,7 @@ module Effective
|
|
204
204
|
flash[:success] ||= flash_success(resource, action)
|
205
205
|
|
206
206
|
format.html { redirect_to(resource_redirect_path) }
|
207
|
-
format.js {
|
207
|
+
format.js {} # create.js.erb
|
208
208
|
else
|
209
209
|
flash.now[:danger] ||= flash_danger(resource, action)
|
210
210
|
|
@@ -264,13 +264,19 @@ module Effective
|
|
264
264
|
@page_title ||= "Destroy #{resource}"
|
265
265
|
EffectiveResources.authorize!(self, :destroy, resource)
|
266
266
|
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
267
|
+
respond_to do |format|
|
268
|
+
if save_resource(resource, :destroy)
|
269
|
+
flash[:success] ||= flash_success(resource, :delete)
|
270
|
+
|
271
|
+
format.html { redirect_to(resource_redirect_path) }
|
272
|
+
format.js {} # delete.js.erb
|
273
|
+
else
|
274
|
+
flash.now[:danger] ||= flash_danger(resource, :delete)
|
272
275
|
|
273
|
-
|
276
|
+
format.html { redirect_to(resource_redirect_path) }
|
277
|
+
format.js {} # delete.js.erb
|
278
|
+
end
|
279
|
+
end
|
274
280
|
end
|
275
281
|
|
276
282
|
# No attributes are assigned or saved. We purely call action! on the resource.
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<% resource = (@_effective_resource || Effective::Resource.new(controller_path)) %>
|
2
|
+
<% @resource = instance_variable_get('@' + resource.name) if resource.name %>
|
3
|
+
|
4
|
+
EffectiveBootstrap.remote_form_payload = $("<%= j render_resource_form(resource) %>");
|
5
|
+
EffectiveBootstrap.remote_form_flash = <%= raw flash.to_json %>;
|
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: 0.8.
|
4
|
+
version: 0.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: 2018-04-
|
11
|
+
date: 2018-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- app/models/effective/resources/sql.rb
|
56
56
|
- app/views/application/_flash.html.haml
|
57
57
|
- app/views/application/create.js.erb
|
58
|
+
- app/views/application/destroy.js.erb
|
58
59
|
- app/views/application/edit.html.haml
|
59
60
|
- app/views/application/index.html.haml
|
60
61
|
- app/views/application/new.html.haml
|