From 7d1d3f176dbc5add5985f9fbdbf8399f4e64d318 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 3 Feb 2017 15:11:34 +0000 Subject: [PATCH] Show all included content types on universe#show, not just core types --- app/views/content/show.html.erb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/app/views/content/show.html.erb b/app/views/content/show.html.erb index c90ba29de..cfd525f13 100644 --- a/app/views/content/show.html.erb +++ b/app/views/content/show.html.erb @@ -115,15 +115,13 @@ <%# TODO: not this %> <% if @content.is_a? Universe %> -
- <%= render partial: 'content/cards/in_universe_content_list', locals: { content_type: :character, content_list: @content.characters } %> -
+ <% content_to_show = [Character, Location, Item, Creature, Race, Religion, Group, Magic, Language, Scene] %> -
- <%= render partial: 'content/cards/in_universe_content_list', locals: { content_type: :location, content_list: @content.locations } %> -
+ <% content_to_show.each do |content_type| %> + <% next if @content.send(content_type.name.downcase.pluralize).empty? %> -
- <%= render partial: 'content/cards/in_universe_content_list', locals: { content_type: :item, content_list: @content.items } %> -
+
+ <%= render partial: 'content/cards/in_universe_content_list', locals: { content_type: content_type.name.downcase.to_sym, content_list: @content.send(content_type.name.downcase.pluralize) } %> +
+ <% end %> <% end %>