lotus_admin 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/lotus_admin/link_helpers.rb +7 -3
- data/lib/lotus_admin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a6d6f7dab65888fc3cc1d0c1823baa23eb80d80605bc11c292bccff92f2242a
|
4
|
+
data.tar.gz: 72edd101b774056720d793cbab45c79f52519add43976762c1a32f1962719037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 442cdf1f5eaf5ee45be321bfdf1dcbd0cf503101abf3a1f441e98521bb3d70a37b802e6526319edac810f46932ece767d389290fb379a27ff73ba87f917ed2f2
|
7
|
+
data.tar.gz: 7427bb13393baf8774e1be6bdc0613bccec45baaac602fb718e8abdedc659c4219bef7ad0b09b94a6c8a0e3bc7da890271635a2d6ca836b01513819512fb9f7c
|
@@ -4,6 +4,10 @@ module LotusAdmin
|
|
4
4
|
render 'lotus_admin/shared/table/actions', resource: resource
|
5
5
|
end
|
6
6
|
|
7
|
+
def undecorated(resource)
|
8
|
+
resource.try(:object).presence || resource
|
9
|
+
end
|
10
|
+
|
7
11
|
def view_resource_item(resource)
|
8
12
|
if policy(resource).show?
|
9
13
|
content_tag(:li) { view_link(resource) }
|
@@ -29,7 +33,7 @@ module LotusAdmin
|
|
29
33
|
end
|
30
34
|
|
31
35
|
def view_link(resource)
|
32
|
-
link_to lotus_admin.polymorphic_path(resource) do
|
36
|
+
link_to lotus_admin.polymorphic_path(undecorated(resource)) do
|
33
37
|
content_tag(:i, nil, class: 'zmdi zmdi-eye')
|
34
38
|
end
|
35
39
|
end
|
@@ -41,13 +45,13 @@ module LotusAdmin
|
|
41
45
|
end
|
42
46
|
|
43
47
|
def edit_link(resource)
|
44
|
-
link_to lotus_admin.edit_polymorphic_path(resource) do
|
48
|
+
link_to lotus_admin.edit_polymorphic_path(undecorated(resource)) do
|
45
49
|
content_tag(:i, nil, class: 'zmdi zmdi-edit')
|
46
50
|
end
|
47
51
|
end
|
48
52
|
|
49
53
|
def destroy_link(resource)
|
50
|
-
link_to lotus_admin.polymorphic_path(resource), data: { method: :delete, confirm: "Are you sure you want to remove this #{ resource.model_name.human }?" } do
|
54
|
+
link_to lotus_admin.polymorphic_path(undecorated(resource)), data: { method: :delete, confirm: "Are you sure you want to remove this #{ resource.model_name.human }?" } do
|
51
55
|
content_tag(:i, nil, class: 'zmdi zmdi-delete')
|
52
56
|
end
|
53
57
|
end
|
data/lib/lotus_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lotus_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Millsaps-Brewer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|