REST API for Search (#6277).

Patch by Akiko Takano and Takenori TAKAKI.

git-svn-id: http://svn.redmine.org/redmine/trunk@15262 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2016-03-19 09:42:35 +00:00
parent 06dec37f49
commit 5533a2b5f2
3 changed files with 85 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
class SearchController < ApplicationController
before_filter :find_optional_project
accept_api_auth :index
def index
@question = params[:q] || ""
@@ -73,7 +74,10 @@ class SearchController < ApplicationController
else
@question = ""
end
render :layout => false if request.xhr?
respond_to do |format|
format.html { render :layout => false if request.xhr? }
format.api { @results ||= []; render :layout => false }
end
end
private