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

Problem with "id" attribute in PUT #41

Closed
ulmus opened this issue Jul 2, 2011 · 4 comments
Closed

Problem with "id" attribute in PUT #41

ulmus opened this issue Jul 2, 2011 · 4 comments

Comments

@ulmus
Copy link
Contributor

ulmus commented Jul 2, 2011

My standard views won't accept the "id" attribute when PUTing to them, I always get the {"field-errors": {"id": ["This field does not exist."]}} response

@tomchristie
Copy link
Member

Any chance you could get a minimal example project together on GitHub or something, and I'll take a look?

@ulmus
Copy link
Contributor Author

ulmus commented Jul 2, 2011

I'll do that!

@ulmus
Copy link
Contributor Author

ulmus commented Jul 2, 2011

I might have found it, I was bootstrapping models in Backbone.js using id and then trying to update them to the server. I'll look into it a bit more, but I think that was it.

@ulmus
Copy link
Contributor Author

ulmus commented Jul 2, 2011

I checked the DocumentHTML interface vs what Backbone.js was sending and it turns out that while Backbone.js sends all attributes, including id on a PUT, the API HTML admin interface only sends the attributes sans id. I stripped out "id" in the Backbone.sync method and now it works!

@ulmus ulmus closed this as completed Jul 2, 2011
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

2 participants