Have single result searches go to the show pages for certain controllers #4204
This commit is contained in:
@@ -18,7 +18,7 @@ class WikiPagesController < ApplicationController
|
||||
def index
|
||||
@wiki_pages = WikiPage.paginated_search(params)
|
||||
|
||||
if params[:redirect].to_s.truthy? && @wiki_pages.one?
|
||||
if params[:redirect].to_s.truthy? && @wiki_pages.one? && @wiki_pages.first.title == WikiPage.normalize_title(params[:search][:title])
|
||||
redirect_to @wiki_pages.first
|
||||
else
|
||||
respond_with(@wiki_pages)
|
||||
|
||||
Reference in New Issue
Block a user