Screencast Rails-API - Part 1 Ruby

  • Josh Van Cleef
  • 6076 views
Badge-student

Locked Content

A subscription is required for viewing this video. Enroll now to get full access to all Code School courses and content.

Enroll Now Sign in

Comments

  1. Jake Craige said

    Excellent! There needs to be more information on this as I was having lots of trouble integrating my api with a sample angular app. Can't wait for part 2

  2. Matt Payne said

    Please post the URLs to the github repo(s)

  3. Faculty

    Olivier Lacan said

    Matt, the GitHub repo is linked to from the resources tab.

  4. aldosolis@gmail.com said

    Nice screencast! It would be great if there were a speed control.

  5. Mark said

    Great tutorial!

  6. Theo said

    I don't understand what does the rails-api gem offer? Serving JSON from controllers is something that's already possible with rails.

    As far as I could tell it's exactly the same workflow, just that the rails-api generator didn't include the extra files required by a classic rails app.

    Is that the only difference?

  7. Orlando Del Aguila said

    @Theo, no, the difference is that rails-api is a much lighter stack. For example, it doesn't have all modules included in the ActionController class ( rails-api: https://github.com/rails-api/rails-api/blob/master/lib/rails-api/action_controller/api.rb#L125 / rails: https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/base.rb) and rails-api doesn't care about views or assets. Also, since you are not using a lot of middleware, it makes the app faster than a normal rails app.

  8. levc said

    Nice tutorial. In which cases would it be more suitable to use Rails::API than Grape?

  9. Andrew said

    I did not get the same output. I just got an array... I followed the video closely - it would help if there was an text writeup of the workflow.

  10. Faculty

    Carlos Souza said

    Levc, Rails::API > Grape for cases where you will be working with other people that might not be familiar with Grape. By using Rails::API, you are still getting all conventions and best-practices that a conventional Rails application offers out of the box.

  11. Justin Calleja said

    Olivier, I think Matt was referring to the github repo for the app in the screen cast... not the one of rails-api - that's somewhat more popular and easy to find ;)

    Of course, since it isn't in the resources, I'm guessing the app has no public repo... which is ok since it's easy to follow along from the vid. Still, why not?

About This Screencast

With the rise of mobile applications, Angular.js and Ember.js support an increasing number of use cases where you only need Rails to serve an API and you can do away with the front-end. This is where the rails-api gem comes in.

You need to be an enrolled student in order to view this video and subscribe.

Enroll Now