4

I'm creating a JavaScript web app. I want to use Ruby on Rails to provide the API to the data in JSON format. I am writing the front-end entirely in JavaScript that will make Ajax calls to the API. This way, I will have a consistent data API when I can write different apps on different platforms.

I'm new to Ruby on Rails and I'm not sure if this is a good approach. If so, could you help me point to a good tutorial to implement the back-end that I just mentioned? If not, please help suggest a good way.

2
  • I don't want to have anything to do with "haml" files since they look very like JSP pages. Commented Apr 10, 2012 at 9:48
  • What type of site you are going to plan/build ? Commented Apr 10, 2012 at 9:58

2 Answers 2

2

Api example code : https://github.com/pigon-web-services/api-app/blob/master/app/controllers/location_controller.rb

How to use this api with javascript : http://pigon.ws/examples/jsonp?api=locationapi

Sign up to request clarification or add additional context in comments.

Comments

2

I didn't work with it yet, but the Rails-API gem by spastorino might be helpful.

Also there is a Railscast on this, so you might want to check this out as a starting point

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.