Skip to content

Instantly share code, notes, and snippets.

@jpemberthy
Created May 13, 2011 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jpemberthy/971177 to your computer and use it in GitHub Desktop.
Save jpemberthy/971177 to your computer and use it in GitHub Desktop.
def index
search = PartnerPage.find_all_by_indexed_name(params[:term])
names = search.hits.map do |h|
name = h.stored(:name_kword)
url = partner_page_url(h.stored(:friendly_id))
{ :value => name, :id => url }
end
render :json => names.uniq
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment