diff --git a/app/models/communication/website/category.rb b/app/models/communication/website/category.rb index a805bbd3b8eabf7c62b2dfbe09ad02658bf7020a..a00ecbed67f334488394e52bd07426ad5069b111 100644 --- a/app/models/communication/website/category.rb +++ b/app/models/communication/website/category.rb @@ -107,6 +107,10 @@ class Communication::Website::Category < ApplicationRecord self.class.unscoped.where(parent: parent, university: university, website: website).where.not(id: id) end + def slug_with_ancestors_slugs + (ancestors.map(&:slug) << slug).join('/') + end + protected def last_ordered_element diff --git a/app/views/admin/communication/websites/posts/static.html.erb b/app/views/admin/communication/websites/posts/static.html.erb index 493680a8aa702d455a9b0ea64e4c821b5122c953..21a4f9d174399ccedb2d9fd5390816bd9887d771 100644 --- a/app/views/admin/communication/websites/posts/static.html.erb +++ b/app/views/admin/communication/websites/posts/static.html.erb @@ -12,7 +12,7 @@ authors: <% if @about.categories.any? %> categories: <% @about.categories.each do |category| %> - - "<%= category.slug %>" + - "<%= category.slug_with_ancestors_slugs %>" <% end %> <% end %> <%= render 'admin/communication/unsplash/static' %>