radar / guides

Guides for Ruby and Elixir and whatever else I feel like
1.52k stars 164 forks source link

ember.md Posts array #44

Closed gringocl closed 10 years ago

gringocl commented 10 years ago

In app/assets/javascripts/models/post.js.coffee something with this code

Blorgh.Post = Ember.Object.extend({})

Blorgh.Post.reopenClass
  findAll: ->
    posts = Em.A()
    $.getJSON('/api/posts').then (data) ->
      $.each data.posts, (post) ->
        posts.pushObject(data)
    posts

is giving me an TypeError in Jquery

Uncaught TypeError: Cannot read property 'length' of undefined

radar commented 10 years ago

Could you please put the code for this app up on GitHub and give me a link?

On Sat, Apr 5, 2014 at 5:17 PM, Miles Starkenburg notifications@github.com wrote:

In app/assets/javascripts/models/post.js.coffee something with this code

Blorgh.Post = Ember.Object.extend({})
Blorgh.Post.reopenClass
  findAll: ->
    posts = Em.A()
    $.getJSON('/api/posts').then (data) ->
      $.each data.posts, (post) ->
        posts.pushObject(data)
    posts

is giving me an TypeError in Jquery

Uncaught TypeError: Cannot read property 'length' of undefined

Reply to this email directly or view it on GitHub: https://github.com/radar/guides/issues/44

radar commented 10 years ago

I think I just need to push a couple of things to blorgh actually...

On Sat, Apr 5, 2014 at 5:52 PM, Ryan Bigg radarlistener@gmail.com wrote:

Could you please put the code for this app up on GitHub and give me a link? On Sat, Apr 5, 2014 at 5:17 PM, Miles Starkenburg notifications@github.com wrote:

In app/assets/javascripts/models/post.js.coffee something with this code

Blorgh.Post = Ember.Object.extend({})
Blorgh.Post.reopenClass
  findAll: ->
    posts = Em.A()
    $.getJSON('/api/posts').then (data) ->
      $.each data.posts, (post) ->
        posts.pushObject(data)
    posts

is giving me an TypeError in Jquery

Uncaught TypeError: Cannot read property 'length' of undefined

Reply to this email directly or view it on GitHub: https://github.com/radar/guides/issues/44

gringocl commented 10 years ago

Here is the link to my code

https://github.com/gringocl/blorgh/blob/rails/app/assets/javascripts/models/post.js.coffee

radar commented 10 years ago

Please try and update from blorgh again.