Skip to content

Instantly share code, notes, and snippets.

@tpendragon
Forked from Viswanathantv/search
Last active December 26, 2015 03:39
Show Gist options
  • Save tpendragon/7086999 to your computer and use it in GitHub Desktop.
Save tpendragon/7086999 to your computer and use it in GitHub Desktop.
class MainsController < ApplicationController
def index
[City, State, Country].each do |klass|
@search = klass.search(params[:q])
@result = @search.result
break unless @result.blank?
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment