rosa-build/app/controllers/search_controller.rb

14 lines
430 B
Ruby
Raw Normal View History

class SearchController < ApplicationController
2014-11-17 21:17:03 +00:00
include PaginateHelper
2015-03-04 23:19:19 +00:00
before_action :authenticate_user! unless APP_CONFIG['anonymous_access']
# load_and_authorize_resource
def index
2014-11-17 21:17:03 +00:00
@type = Search::TYPES.find{ |t| t == params[:type] } || Search::TYPES.first
@query = params[:query]
@search = Search.new(@query, current_ability, paginate_params)
@collection = @search.send(@type)
end
end