|
|
|
@ -32,7 +32,11 @@ class QueryMenuItemsController < ApplicationController |
|
|
|
|
|
|
|
|
|
def create |
|
|
|
|
@query_menu_item = MenuItems::QueryMenuItem.find_or_initialize_by_name_and_navigatable_id normalized_query_name, @query.id, title: @query.name |
|
|
|
|
flash[:error] = l(:error_menu_item_not_created) unless @query_menu_item.save |
|
|
|
|
if @query_menu_item.save |
|
|
|
|
flash[:notice] = l(:notice_successful_create) |
|
|
|
|
else |
|
|
|
|
flash[:error] = l(:error_menu_item_not_created) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
redirect_to query_path |
|
|
|
|
end |
|
|
|
|