Am working in rails. If I send a request like http://www.example.com/titles/search?search_text=something
as a respond I need a Json .How to implement this in Rails?
Am working in rails. If I send a request like http://www.example.com/titles/search?search_text=something as a respond
Share
If you want a response in JSON format then you need to pass your request as url.json format.
In your controller, inside that action check your request format and return the result according to the requested format. You can read more about this here and having example source code as wel. Check it out here Rendering JSON and other formats.