Skip to content

Commit

Permalink
try to get route set up correctly; ember still not handling the retur…
Browse files Browse the repository at this point in the history
…ned hash correctly
  • Loading branch information
kellen hart committed Sep 9, 2013
1 parent 120acb4 commit 799de20
Show file tree
Hide file tree
Showing 9 changed files with 23,182 additions and 24,608 deletions.
5 changes: 4 additions & 1 deletion app/assets/javascripts/models/song.js.coffee
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
attr = DS.attr

Pah.Song = DS.Model.extend
# url: 'songs'
name: attr()
id: attr()
3 changes: 1 addition & 2 deletions app/assets/javascripts/routes/song_route.js.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Pah.SongRoute = Ember.Route.extend
model: (params) ->
songs.findBy('id', params.song_id)
model: (params) -> songs.findBy('id', params.song_id)
1 change: 1 addition & 0 deletions app/assets/javascripts/routes/songs_route.js.coffee
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Pah.SongsRoute = Ember.Route.extend
model: -> @store.findAll('song')

10 changes: 3 additions & 7 deletions app/assets/javascripts/store.js.coffee
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# http://emberjs.com/guides/models/defining-a-store/

Pah.Store = DS.Store.extend
revision: 11
adapter: DS.RESTAdapter.create()

# Pah.Store.registerAdapter('Pah.Songs', DS.RESTAdapter.extend({
# url: "/songssss"
# }));
# Pah.Store = DS.Store.extend
# revision: 11
# adapter: DS.RESTAdapter.create()
2 changes: 2 additions & 0 deletions app/controllers/songs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ class SongsController < ApplicationController
respond_to :json

def index
@songs = Song.all

respond_with @songs
end
end
Loading

0 comments on commit 799de20

Please sign in to comment.