-
Notifications
You must be signed in to change notification settings - Fork 130
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
Documentation on Post and Put methods #75
Comments
There's nothing different or fancy about processing requests like that - have you just tried following the samples in: http://guides.rubyonrails.org/action_controller_overview.html and |
Ok cool, those "expose" and "collection" methods were looking kinda special and I wasn't sure if there was a PUT and POST equivalent. So I'll just do etc. Thanks! |
expose/collection are purely to simplify OUTPUT of anything! so you can do:
which will render out the result of the creation (i.e. the object itself), and if you do Post.create!() it'll render out the validation errors automatically without doing anything else. kindof like magic, but it's not i promise. (one more note: whenever you have a question like this, check the source first, expose is a super simple method and really just wraps some stuff around render_json) |
See why we should add the examples? :o) Thanks! ~ Adam Braus On Friday, September 27, 2013 at 5:19 PM, mbhnyc wrote:
|
Hi, love rocket_pants as I am learning APIs. I think a big win for us nubes would be to include Post and Put requests (Create and Update methods) in the docs. Right now its just GET requests and index/show methods.
These examples are lacking here and in the linked sample app.
Thanks!
The text was updated successfully, but these errors were encountered: