From 20588a7848a8370c9e53bf0bb11e0983e9da46bb Mon Sep 17 00:00:00 2001 From: ghostrigger Date: Sat, 11 May 2013 21:52:37 +0800 Subject: [PATCH] fixes #1578 hopefully pulls the `query` parameter from url; removes the `user:` prefix. there must be more elegant solution than this. --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 4f53f744d..0a1f50ba6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -239,7 +239,7 @@ Danbooru::Application.routes.draw do match "/comment/index" => redirect {|params, req| "/comments?page=#{req.params[:page]}"} match "/comment/show/:id" => redirect("/comments/%{id}") match "/comment/new" => redirect("/comments") - match "/comment/search" => redirect("/comments/search") + match "/comment/search" => redirect {|params, req| "/comments?group_by=comment&search[creator_name]=#{CGI::escape(req.params[:query].to_s).sub!(/^user(%3A|%253A|:)/, '')}"} match "/favorite" => redirect {|params, req| "/favorites?page=#{req.params[:page]}"} match "/favorite/index" => redirect {|params, req| "/favorites?page=#{req.params[:page]}"}