Skip to content

Instantly share code, notes, and snippets.

@digilord
Created January 7, 2014 22:07
Show Gist options
  • Select an option

  • Save digilord/8307808 to your computer and use it in GitHub Desktop.

Select an option

Save digilord/8307808 to your computer and use it in GitHub Desktop.
@Lexicon = new Meteor.Collection "lexicon"
@Langs = new Meteor.Collection(null)
if Meteor.isServer
for lang in Lexicon.distinct('lang')
Langs.insert lang
Meteor.publish 'lexicon', () ->
return Lexicon.find()
Meteor.publish 'langs', () ->
return Langs.find()
if Meteor.isClient
Meteor.subscribe("langs")
Template.lang.rendered = ->
$("#langs").autocomplete {source: Langs.find().fetch()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment