Skip to content
Snippets Groups Projects
Commit 7bbc46dd authored by pabois's avatar pabois
Browse files

Merge branch 'main' of github.com:noesya/osuny

parents df00d487 57c45d30
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ class Admin::Communication::Websites::Menus::ItemsController < Admin::Communicat
@item.menu = @menu
@item.website = @website
if @item.save
redirect_to admin_communication_website_menu_path(@menu),
redirect_to redirect_path(@item),
notice: t('admin.successfully_created_html', model: @item.to_s)
else
breadcrumb
......@@ -63,7 +63,7 @@ class Admin::Communication::Websites::Menus::ItemsController < Admin::Communicat
def update
if @item.update(item_params)
redirect_to admin_communication_website_menu_path(@menu),
redirect_to redirect_path(@item),
notice: t('admin.successfully_updated_html', model: @item.to_s)
else
breadcrumb
......@@ -80,6 +80,11 @@ class Admin::Communication::Websites::Menus::ItemsController < Admin::Communicat
protected
def redirect_path(item)
item.parent.nil? ? admin_communication_website_menu_path(item.menu)
: admin_communication_website_menu_item_path(id: item.parent)
end
def breadcrumb
super
add_breadcrumb Communication::Website::Menu.model_name.human(count: 2),
......
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