
front and back-end web development, Leeds, UK
Richard's Blog - Design, coding and life in Japan
REST
JSON Data for multiple objects and associations in Rails
Submitted by Richard on Tue, 10/20/2009 - 08:58I am creating a REST API in Rails which outputs JSON data. In some cases I need multiple objects to be pushed out in the data, which is fine until you need to use associations in the mix also.
Example:
form = Form.find(params[:id]) products = Product.all
Tags:
Recent Blog Posts
- Testing controllers in Lithium 2nd Feb 12, 18:19
- Practical Internationalization in Lithium 31st Dec 11, 02:06
- Using OAuth in Lithium 30th Dec 11, 23:47
- How to add your own Tokens from CCK fields in Druapl 7 17th Jun 11, 04:49
- Weaving Lithium #li3 into a legacy PHP application incrementally 5th Oct 10, 11:54