bloc referral

If you are interested in learning to code with a mentor, try bloc and get $100 off.

Tuesday, February 17, 2015

Rails API gem

I recently took on the task to create a Rails API gem for an Ember project I am working on. for STEAMrole. It is still very much in the beginning stages but I have both the Rails and Ember playing rather nice together.

Some noticeable differences in the way I started this project was I actually started with the Ember's client side application first. I wish I could say it was rather simple but I did have some hang-ups, specially while working with fixtures. The issue turned out be how was requiring the file,  it wasn't actually an Ember thing. More details here.

At this point I have been writing test and working with the Twitter API to gather some data that is needed for that app. One of the real wins for Ember and other Javascript frameworks is the separation of concerns. I am able to work on the Rails database without concerning myself with the Front-End and vice versa.

My overall experience with the Rails API gem, not only am I able to throw an api together rather quickly with scaffolding. It also sets up some simple controller test to assert true, unfortunately they were written in Minitest. I am not aware if they could be scaffolded into Rspec as of yet, as this is my first Rails API project and I didn't setup rspec-rails yet, but have decided just to follow through with Minitest DSL for this.

The coolest thing about using this gem is being able to see the JSON data in your localhost with not a lot of effort. I highly recommend this tutorial to get you started using the Rails API gem, feel free to skip the Ember stuff if that doesn't excite you.

I am not finished with my current project, but If you interested in seeing one of my Rails API project live, check out Interpersonal Movie Database.

To get started do the follow:


No comments:

Post a Comment