rosa-build/app/controllers/search_controller.rb

18 lines
450 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,
{:page => params[:page]}
).each do |k, v|
var = :"@#{k}"
instance_variable_set var, v unless instance_variable_defined?(var)
end
end
end