Skip to content

Instantly share code, notes, and snippets.

@srt32
Last active August 29, 2015 14:02
Show Gist options
  • Save srt32/3f090296e76a77987d04 to your computer and use it in GitHub Desktop.
Save srt32/3f090296e76a77987d04 to your computer and use it in GitHub Desktop.
class SearchesController < ApplicationController
def index
@tools = Tool.search do
keywords params[:query]
end.results
@inventories = Inventory.search do
keywords params[:query]
end.results
respond_to do |format| ## format is defined here
format.html { render template: "tools#index" }
end
end
end
### Routes
resources :searches, only: [:index]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment