You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.
Hi,
I'm a eco newbie and I'm trying to integrate it with Backbone. I checked out Ryan Bates' RailsCast example. However, I'm having trouble accessing a simple get.
I can do this: <%= @stream.get('stream_type') %> which returns "project"
But how do I get user.name? I tried <%= @stream.user.get('name') %> but I got error: Uncaught TypeError: Cannot call method 'get' of undefined
If user is a Backbone model, then you should use @stream.get('user').get('name'). You need to use get() to access the user attribute, and user is a Backbone model.
The best way to debug issues like this is to insert either a breakpoint in your compiled template in chrome/firebug, or a debugger statement in the code, which chrome/firebug will detect and pause output. Then you can just check "this" in the debugger and fiddle until you find the right reference.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I'm a eco newbie and I'm trying to integrate it with Backbone. I checked out Ryan Bates' RailsCast example. However, I'm having trouble accessing a simple get.
I can do this: <%= @stream.get('stream_type') %> which returns "project"
But how do I get user.name? I tried <%= @stream.user.get('name') %> but I got error: Uncaught TypeError: Cannot call method 'get' of undefined
[
: {
: : "id":"5004095283de4ca9ff000005",
: : "stream_type":"project",
: : "user":
: : {
: : : "id":"5002f30560de7d0ffb000003",
: : : "name":"Regular User2"
: : },
The text was updated successfully, but these errors were encountered: