Rails 3: What is the proper way to respond to REST-ful actions with JSON in rails?
Posted
by Damien Wilson
on Stack Overflow
See other posts from Stack Overflow
or by Damien Wilson
Published on 2010-04-03T20:31:18Z
Indexed on
2010/04/03
20:33 UTC
Read the original article
Hit count: 485
Hello SO.
I'm trying to make an API for my rails application using JSON responses to RESTful resource controllers. This is a new experience for me, so I'm looking for some guidance and pointers. To start things off:
- In a rails application, what is the "proper" way to respond with JSON to REST-ful controller methods? (create, update, destroy)
- Is there an idiomatic way to indicate success/failure through a JSON response?
Additional information:
- I'm currently working with rails 3.0.beta2
- I would like to avoid using a plugin or gem to do the grunt work, my goal is to gain a better understanding of how to make a rails 3 API.
- Links to places I could find more information on the topic would also be appreciated, some quick searching on google didn't do me much good.
© Stack Overflow or respective owner