Skip to content

Instantly share code, notes, and snippets.

@j-mcnally
Created September 22, 2012 00:53
Show Gist options
  • Select an option

  • Save j-mcnally/3764727 to your computer and use it in GitHub Desktop.

Select an option

Save j-mcnally/3764727 to your computer and use it in GitHub Desktop.
{view App.InlineSelect contentBinding="this.content" optionLabelPath="content.label" optionValuePath="content.value" optionItems="$20,000 - $50,000|$50,000 - $80,000|$80,000 - $100,000|$100,000 - $150,000|$200,000 - $300,000"}}
App.InlineSelect = Ember.Select.extend
  optionItems: null
  content: ( ->
    content = []
    oArray = @get('optionItems').split("|")
    oArray.forEach (option) ->
      o = Ember.Object.create({
        label: option
        value: option
      })
      content.push(o)
    content
  ).property('optionItems')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment