diff --git a/app/controllers/admin/communication/extranets/posts_controller.rb b/app/controllers/admin/communication/extranets/posts_controller.rb index 578f80b73d3133ef0ebadd09e7b264b9b2200cfb..256602b6eb73ae510da558f14e56fecbb3c8c6b2 100644 --- a/app/controllers/admin/communication/extranets/posts_controller.rb +++ b/app/controllers/admin/communication/extranets/posts_controller.rb @@ -3,7 +3,6 @@ class Admin::Communication::Extranets::PostsController < Admin::Communication::E def index breadcrumb - add_breadcrumb Communication::Extranet.human_attribute_name(:feature_posts) end def show @@ -35,7 +34,6 @@ class Admin::Communication::Extranets::PostsController < Admin::Communication::E if @post.save redirect_to admin_communication_extranet_post_path(@post), notice: t('admin.successfully_created_html', model: @post.to_s) else - load_categories breadcrumb render :new, status: :unprocessable_entity end @@ -46,7 +44,6 @@ class Admin::Communication::Extranets::PostsController < Admin::Communication::E if @post.update(post_params) redirect_to admin_communication_extranet_post_path(@post), notice: t('admin.successfully_updated_html', model: @post.to_s) else - load_categories breadcrumb add_breadcrumb t('edit') render :edit, status: :unprocessable_entity @@ -62,8 +59,7 @@ class Admin::Communication::Extranets::PostsController < Admin::Communication::E def breadcrumb super - add_breadcrumb Communication::Extranet::Post.model_name.human(count: 2), - admin_communication_extranet_posts_path + add_breadcrumb Communication::Extranet::Post.model_name.human(count: 2), admin_communication_extranet_posts_path breadcrumb_for @post end diff --git a/app/models/communication/extranet/post.rb b/app/models/communication/extranet/post.rb index 98bba0b1094242d3aa7cb4db29719daf4e544e40..063fc6dbb9344f6d0ff4044c31dc01690425c936 100644 --- a/app/models/communication/extranet/post.rb +++ b/app/models/communication/extranet/post.rb @@ -36,7 +36,7 @@ class Communication::Extranet::Post < ApplicationRecord include WithPermalink include WithSlug - belongs_to :author, class_name: 'University::Person' + belongs_to :author, class_name: 'University::Person', optional: true belongs_to :extranet, class_name: 'Communication::Extranet' validates :title, presence: true