mardi 21 avril 2015

Basic API in Rails

Let's assume I have a Users controller with a returnjson action. Say I want to create an API so when the client calls on that method, it would return the user's data to the client. For example:

http://ift.tt/1DINM2i

A get request would be made by JavaScript with that URL and than the rails would than return the user info in a JSON format. How would I got about doing this?

Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire