rosa-build/app/controllers/search_controller.rb

18 lines
447 B
Ruby
Raw Normal View History

class SearchController < ApplicationController
before_filter :authenticate_user! unless APP_CONFIG['anonymous_access']
# load_and_authorize_resource
def index
2012-11-21 12:09:01 +00:00
@type = params[:type] || 'all'
@query = params[:query]
2012-11-21 15:04:41 +00:00
Search.by_term_and_type(
@query,
@type,
2014-01-21 04:51:49 +00:00
{page: params[:page]}
2012-11-21 15:04:41 +00:00
).each do |k, v|
var = :"@#{k}"
instance_variable_set var, v unless instance_variable_defined?(var)
end
end
end