Skip to content
Snippets Groups Projects
Commit 9d08fcd3 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

fix

parent a1b5d202
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment