Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docs: root models must be Objects and not Strings or Arrays #71

Closed
quangv opened this issue Jan 27, 2013 · 2 comments
Closed

Update Docs: root models must be Objects and not Strings or Arrays #71

quangv opened this issue Jan 27, 2013 · 2 comments

Comments

@quangv
Copy link

quangv commented Jan 27, 2013

Root array methods doesn't work.

model.set 'list', []
model.push 'list', 1  # doesn't work

model.set 'list.list', []
model.push 'list.list', 1  # works

Seems like Derby allows root arrays, so the above code should work?

Updated via IRC:

<quangv> i think model.set 'list.items', []   model.push 'list.items', 'test'   works though
<quangv> model roots need to be a namespace or something?
<switz> yes
<switz> list is your id
<switz> therefore if you set list, it has to be an object
<switz> it can't be an array or a string
<switz> or a number
<quangv> hey switz, dang I just filed a bug https://github.com/codeparty/racer/issues/71
<quangv> http://derbyjs.com/#paths  made it seem that fruits : [] is allowed...
<quangv> switz, that's weird so it can't be a string either?
<switz> local models can be strings
<switz> local models are prefaced with _
<switz> and are not saved to the server
<switz> or database
<quangv> so model.set('title', 'Fruit store') shouldn't be used either?
<switz> no
<quangv> i see
<switz> but you can do page.render('index', {title: 'Fruit store'})
<quangv> okay I am going to copy & paste our convo to the bug i just filed and suggest the documentation be changed.
@razic
Copy link

razic commented Apr 25, 2013

/bump

@nateps
Copy link
Contributor

nateps commented Jun 4, 2013

No longer relevant in 0.5

@nateps nateps closed this as completed Jun 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants