mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user