Skip to content

Instantly share code, notes, and snippets.

@jsl
Forked from jpemberthy/gist:971177
Created May 13, 2011 19:50
Show Gist options
  • Save jsl/971195 to your computer and use it in GitHub Desktop.
Save jsl/971195 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