lotus_admin 1.5.5 → 1.5.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: 7e57539d667b82f3e4212841eb753c5ad31c65c7c3e67ebb38660032f56c1a4e
4
- data.tar.gz: 965da47c55f3f89e867fc4baa338013c49b896712db2eb1b146869dba1f0aa95
3
+ metadata.gz: 9722e072421aa225525f1705c81d9c2fe9e99d62855019955eb1426b3f59f502
4
+ data.tar.gz: 73d6a3ab005224e36ab8c3ee9ec043cd891fa22a12930dbd75b46743420988b4
5
5
  SHA512:
6
- metadata.gz: ae1f254edaa96c81589c526b955d2f099768a69b68999ddd8155b1e0f414cbf72f266ea3922765add1059c3a340f2fa26ade8e978871c2f6717f8b8be5621dae
7
- data.tar.gz: 27e4aef7ba354a1c039eb6bc4aef087e8477aef3ab6d537b147f26f9ece1a90a55568da42b4152ad927bf658092aaea95537e115fb55471b2fac3e256f279dcf
6
+ metadata.gz: 1d71e3209dcc0d0598fda166312c87d71ec7bab0bfbdbca990b7425ef208f691efced1b4e886eac145c400050eff4dad52a7ec2d6b0ad147847cf3267dadd224
7
+ data.tar.gz: 5f42cbcc462a5c95691cf85b4b713b9291be648f544ee425a9774739075e575ddcec5b38bc98ea8d46ff59a8ba21e21ed0f6f427f5a53dca433dbd1e78a74d67
@@ -81,20 +81,34 @@ class LotusAdmin::ResourceController < LotusAdmin::AuthenticatedController
81
81
  end
82
82
  end
83
83
 
84
- def show
84
+ def show(&block)
85
85
  authorize(resource) if using_pundit?
86
+
87
+ respond_to do |format|
88
+ format.html
89
+
90
+ block.call(format) if block.present?
91
+ end
86
92
  end
87
93
 
88
- def destroy
94
+ def destroy(&block)
89
95
  authorize(resource) if using_pundit?
90
96
 
91
- if resource.destroy
92
- flash[:notice] = "#{ resource_class.model_name.human } has been removed"
93
- else
94
- flash[:error] = "There was an error removing that #{ resource_class.model_name.human }"
95
- end
97
+ respond_to do |format|
98
+ format.html
96
99
 
97
- redirect_to after_destroy_redirect
100
+ if block.present?
101
+ block.call(format)
102
+ else
103
+ if resource.destroy
104
+ flash[:notice] = "#{ resource_class.model_name.human } has been removed"
105
+ else
106
+ flash[:error] = "There was an error removing that #{ resource_class.model_name.human }"
107
+ end
108
+
109
+ redirect_to after_destroy_redirect
110
+ end
111
+ end
98
112
  end
99
113
 
100
114
  private
@@ -1,3 +1,3 @@
1
1
  module LotusAdmin
2
- VERSION = '1.5.5'
2
+ VERSION = '1.5.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lotus_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.5
4
+ version: 1.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Millsaps-Brewer