effective_resources 0.8.14 → 0.8.15

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
  SHA1:
3
- metadata.gz: 68074e96512d111e7b55e78fd29b1b15496f4363
4
- data.tar.gz: df35b07a9314f9f181b3505e808b1693d4d9756c
3
+ metadata.gz: 379383cd8b7fbf6f68822d2c23fe3a715c3374c7
4
+ data.tar.gz: d7f66a8b0636d9d89c29e93a27ed1d9e145f53fa
5
5
  SHA512:
6
- metadata.gz: ba76ceb463231bbf9c61e844ddc39dd60cd010c18b61bc7d121ed890ead8bc97e15aafacd96a50ba208c67211578b20a0ac30a82769e2c679de263fe8d3f5aec
7
- data.tar.gz: 44235f52f3fdfcf346b4fec727439b032ba51e82928bcf21ab43f554161d59b95d585359490c20da636cbbd41cafaf9cdd376b901abcc422f9f00098daecab17
6
+ metadata.gz: 3558655992943e761ffe3f3cafcc81ae3f90c2cb613837c90308ecc2f42e55d85c944eae190e7a68e67069d8cd154b8c1bc7f3356c1a52fd9f84915a045a8233
7
+ data.tar.gz: 23a713c5aef042f0e45cae0e139aeea21c9e1e0f519f54b2960df8b6fd647ea13cdd54ce70023504b88407954c2a5bc0b534322434cb7f3c2e07338374518590
@@ -294,13 +294,13 @@ module Effective
294
294
  if save_resource(resource, action)
295
295
  format.html do
296
296
  flash[:success] ||= resource_flash(:success, resource, action)
297
- redirect_to(resource_redirect_path)
297
+ redirect_to(resource_redirect_path(action))
298
298
  end
299
299
 
300
300
  format.js do
301
301
  if specific_redirect_path?
302
302
  flash[:success] ||= resource_flash(:success, resource, action)
303
- redirect_to(resource_redirect_path)
303
+ redirect_to(esource_redirect_path(action))
304
304
  else
305
305
  flash.now[:success] ||= resource_flash(:success, resource, action)
306
306
  # destroy.js.erb
@@ -310,8 +310,8 @@ module Effective
310
310
  flash.delete(:success)
311
311
 
312
312
  format.html do
313
- flash[:danger] ||= resource_flash(:danger, resource, action)
314
- redirect_to(resource_redirect_path)
313
+ flash[:danger] = (flash.now[:danger].presence || resource_flash(:danger, resource, action))
314
+ redirect_to(resource_redirect_path(action))
315
315
  end
316
316
 
317
317
  format.js do
@@ -471,6 +471,10 @@ module Effective
471
471
 
472
472
  return commit_action_redirect if commit_action_redirect.present?
473
473
 
474
+ if action == :destroy
475
+ return [referer_redirect_path, resource_index_path, root_path].compact.first
476
+ end
477
+
474
478
  case params[:commit].to_s
475
479
  when 'Save'
476
480
  [resource_edit_path, resource_show_path, resource_index_path]
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '0.8.14'.freeze
2
+ VERSION = '0.8.15'.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: 0.8.14
4
+ version: 0.8.15
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-05-18 00:00:00.000000000 Z
11
+ date: 2018-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails