Skip to content

Instantly share code, notes, and snippets.

@fivetwentysix
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fivetwentysix/574f389c3a735e98738c to your computer and use it in GitHub Desktop.
Save fivetwentysix/574f389c3a735e98738c to your computer and use it in GitHub Desktop.
DemoApp.PlayersShowController = Ember.ObjectController.extend
swords: Ember.$.getJSON '/swords'
matches: (->
@get('model.matches').map (match) ->
sword = swords.findBy('external_id', match.sword_id)
name = sword.name.replace('lalala_', '')
match.sword =
img: "/images/sword_#{name}_sb.png"
match
).property('model.matches')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment