Class: Haystack::SearchesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Haystack::SearchesController
- Defined in:
- app/controllers/haystack/searches_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/haystack/searches_controller.rb', line 9 def create @searcher = "#{params[:type]}Searcher".constantize.new @data = @searcher.data respond_to do |format| format.html { render 'new' } format.js { render 'new' } format.json { render :json => @data } end end |
#new ⇒ Object
4 5 6 7 |
# File 'app/controllers/haystack/searches_controller.rb', line 4 def new @data = [] @searcher = "#{params[:type]}Searcher".constantize.new end |