standard_view 0.1.9 → 0.1.10
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a14888d9397034df7bb8174dc0a72b66532e30e8f7132b899c1a7ba3938ccaa
|
|
4
|
+
data.tar.gz: 67938e84a77de461180820c95dd91db3d85161e6da79d57f5c77e310c5c4d7d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d4318a76209a44cec5f92200ad177494a3cbfce5df1b50bdf405b62f19aee3bb30f2ce1201e3a0d40b76851ace2b3a9871833d7b6ab110248b22810666d9811
|
|
7
|
+
data.tar.gz: ccad31258efa6195f0e669a2c4fd210826911479ac0d710d8adb3efa2d02cae377ef8c8a6d74177003c16c7698b7c9f141871490317033691f5ff900fa08df1c
|
|
@@ -74,5 +74,15 @@ module StandardView
|
|
|
74
74
|
related_material = Material::Base.for(related_object)
|
|
75
75
|
link_to related_material.reference_title, related_material
|
|
76
76
|
end
|
|
77
|
+
|
|
78
|
+
def record_from_parent_route
|
|
79
|
+
path_parent_name, path_parent_id = request.path.split("/#{controller_name}")&.first&.split("/").try(:[],1,2)
|
|
80
|
+
return if path_parent_name.blank? || path_parent_id.blank?
|
|
81
|
+
|
|
82
|
+
parent_name = path_parent_name.singularize
|
|
83
|
+
parent_param_key = "#{parent_name}_id"
|
|
84
|
+
parent_id = params[parent_param_key]
|
|
85
|
+
parent_name.camelize.constantize.find(parent_id) if parent_id.present? && parent_id.to_s == path_parent_id
|
|
86
|
+
end
|
|
77
87
|
end
|
|
78
88
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%# For the good-spirited and impossibly lazy developer, we attempt to jump-start, assuming conventions. %>
|
|
2
2
|
<% is_nested = local_assigns[:nested] %>
|
|
3
3
|
|
|
4
|
-
<% facet_source = local_assigns[:facet_source] %>
|
|
4
|
+
<% facet_source = local_assigns[:facet_source] || record_from_parent_route %>
|
|
5
5
|
<% if is_nested && facet_source.nil? %>
|
|
6
6
|
<% facet_source = controller_name.singularize.camelize.constantize.find(params[:id]) %>
|
|
7
7
|
<% end %>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: standard_view
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Garside
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2020-04-
|
|
12
|
+
date: 2020-04-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|