standard_view 0.1.11 → 0.1.12

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: 4c258ef0752dbdba9cd49fcd0277172854b415423f1e3ea0d7797182d206aeea
4
- data.tar.gz: 1b20bbd965bdb8050b4ae65cf8cd0b7846cfacd74991e18e4b42c4b5e384bb6b
3
+ metadata.gz: b5b3fad18e54a169d20a3455742961fd1f2a5271baa992a9a07d6b778e918823
4
+ data.tar.gz: 3684724e01df8912cbaf462705c477bb20c60fc7f2e6275bee4d5a40c48574d6
5
5
  SHA512:
6
- metadata.gz: 785fc53924c7482b289a5b06a22b2e3bb35c975ff919b0de9d3addca3165694d4e9d09e97eb742f500094ca0e9810c8e0a03ff364c64530ebfdab5ee08d61d6d
7
- data.tar.gz: 8fbede84013d14c06335cdcefa5b286ddde2a4bd272d9b28807dec67ad94dab439bf176e0d4e432b3e4e290c5e48a47d31b24c2cc832258d59d25aa5dc9f2777
6
+ metadata.gz: 387a758ad516068f3c0f5601bc1a113d7c222cf5507c4792cde5d1cfc699114a6e2baea19843588f1ce33ad8e5b91229c6b557584f956b024c14ebaf60af41a5
7
+ data.tar.gz: 36d00e8cab5f2ebf65066aa0e29bc55e2ce1b131c8b896551209a3d79cf0d4456e3b90858c8c2225f3963db8b075f0a8894fd6f44815eb9de1ca43c9e9372c41
@@ -12,7 +12,7 @@
12
12
  <li class="breadcrumb-item"><%= link_to parent.breadcrumb_title, parent %></li>
13
13
 
14
14
  <% unless on_page?(controller: parent.route_key, action: material.route_key) %>
15
- <li class="breadcrumb-item"><%= link_to title_for_model(material), [ material.route_key, parent ] %></li>
15
+ <li class="breadcrumb-item"><%= link_to title_for_model(material), [ parent, material.route_key ] %></li>
16
16
  <% end %>
17
17
  <% else %>
18
18
  <li class="breadcrumb-item">
@@ -1,6 +1,11 @@
1
1
  <%# For the good-spirited and impossibly lazy developer, we attempt to jump-start with no code, assuming conventions. %>
2
2
  <% if local_assigns[:material].nil? %>
3
- <% record = "#{controller_name.singularize.camelize}".constantize.new if local_assigns[:record].nil? %>
3
+ <% if local_assigns[:record].nil? %>
4
+ <% if record_from_parent_route.present? && record_from_parent_route.respond_to?(controller_name) %>
5
+ <% collection = record_from_parent_route.public_send(controller_name) %>
6
+ <% end %>
7
+ <% record = collection.try(:build) || "#{controller_name.singularize.camelize}".constantize.new %>
8
+ <% end %>
4
9
  <% material = Material::Base.for(record) %>
5
10
  <% end %>
6
11
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StandardView
4
- VERSION = "0.1.11"
4
+ VERSION = "0.1.12"
5
5
  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.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside