lotus_admin 1.5.5 → 1.5.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 +4 -4
- data/app/controllers/lotus_admin/resource_controller.rb +22 -8
- data/lib/lotus_admin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9722e072421aa225525f1705c81d9c2fe9e99d62855019955eb1426b3f59f502
|
4
|
+
data.tar.gz: 73d6a3ab005224e36ab8c3ee9ec043cd891fa22a12930dbd75b46743420988b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
92
|
-
|
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
|
-
|
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
|
data/lib/lotus_admin/version.rb
CHANGED