Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add a convenience show route that redirects to the queried page

Klaus Zanders62c953558016
diff --git a/app/controllers/projects/queries_controller.rb b/app/controllers/projects/queries_controller.rb
index cc37266a0b0..37377be694e 100644
--- a/app/controllers/projects/queries_controller.rb
+++ b/app/controllers/projects/queries_controller.rb
@@ -31,13 +31,17 @@ class Projects::QueriesController < ApplicationController
# No need for a more specific authorization check. That is carried out in the contracts.
before_action :require_login
- before_action :find_query, only: %i[rename update destroy publish unpublish]
+ before_action :find_query, only: %i[show rename update destroy publish unpublish]
before_action :build_query_or_deny_access, only: %i[new create]
current_menu_item [:new, :rename, :create, :update] do
:projects
end
+ def show
+ redirect_to projects_path(query_id: @query.id)
+ end
+
def new
render template: "/projects/index",
layout: "global",
diff --git a/config/routes.rb b/config/routes.rb
index 80c29d6a84e..06c8a660b8b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -181,7 +181,7 @@ Rails.application.routes.draw do
namespace :projects do
resource :menu, only: %i[show]
- resources :queries, only: %i[new create update destroy] do
+ resources :queries, only: %i[show new create update destroy] do
member do
get :rename