I wrote a web application in ROR, but I want it supports web service, so that I can do the same things on non-web application platform. What should I do to add web service ability to my web application... ...or I need to reinvent my application, to write a separate web service independently?
+3
A:
you want to use responds_to in your controllers. Here is a good explanation.
jshen
2010-02-13 19:26:48
looks easy, can I return JSON instead of XML?
Tattat
2010-02-14 02:42:08
yes, read this for more details. http://www.neeraj.name/blog/articles/612-rails-under-the-hood-how-respond_to-works
jshen
2010-02-14 06:16:16