From 83d8fa2892b748f03aff6a4519da9f48897a313e Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 21 Feb 2018 13:37:14 -0500 Subject: [PATCH] FIX: Allow customized usernames to work in this route Co-authored-by: jjaffeux --- app/controllers/list_controller.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/list_controller.rb b/app/controllers/list_controller.rb index 905f0077cb2..e79137211c0 100644 --- a/app/controllers/list_controller.rb +++ b/app/controllers/list_controller.rb @@ -293,10 +293,11 @@ class ListController < ApplicationController def page_params(opts = nil) opts ||= {} route_params = { format: 'json' } - route_params[:category] = @category.slug_for_url if @category - route_params[:parent_category] = @category.parent_category.slug_for_url if @category && @category.parent_category - route_params[:order] = opts[:order] if opts[:order].present? - route_params[:ascending] = opts[:ascending] if opts[:ascending].present? + route_params[:category] = @category.slug_for_url if @category + route_params[:parent_category] = @category.parent_category.slug_for_url if @category && @category.parent_category + route_params[:order] = opts[:order] if opts[:order].present? + route_params[:ascending] = opts[:ascending] if opts[:ascending].present? + route_params[:username] = UrlHelper.escape_uri(params[:username]) if params[:username].present? route_params end