gitlab-org--gitlab-foss/app/helpers/explore_helper.rb
Dmitriy Zaporozhets bebf34aa47 Make projects sort dropdown shared so it can be reused for other pages
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-04 19:26:10 +01:00

20 lines
455 B
Ruby

module ExploreHelper
def filter_projects_path(options={})
exist_opts = {
sort: params[:sort],
scope: params[:scope],
group: params[:group],
tag: params[:tag],
visibility_level: params[:visibility_level],
}
options = exist_opts.merge(options)
path = request.path
path << "?#{options.to_param}"
path
end
def explore_controller?
controller.class.name.split("::").first == "Explore"
end
end