RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: json xFree Episodes x
Active Model Serializers
Episode #409Mar 09, 2013139 comments

Active Model Serializers

The ActiveModel::Serializers gem can help you build JSON APIs through serializer objects. This provides a dedicated place to fully customize the JSON output. (10 minutes)
REST API Versioning
Episode #350May 16, 2012108 comments

REST API Versioning

APIs should be consistent, but it is difficult to do this when returning a JSON response along side the HTML interface. Here I show how to add a versioned, RESTful API. The version can be determined from either the URL or HTTP headers. (10 minutes)
Private Pub
Episode #316Jan 16, 2012133 comments

Private Pub

Private Pub makes it easier than ever to publish and subscribe to real-time events in a Rails app. You can use publish_to with a block of JavaScript or supply a hash for use with JSON. (7 minutes)
RABL
Episode #322Feb 08, 201264 comments

RABL

RABL - Ruby API Builder Language - provides a DSL for generating JSON or XML responses in a Ruby application. Learn how to share and configure complex JSON data in this episode. (8 minutes)
Jbuilder
Episode #320Jan 30, 201278 comments

Jbuilder

Jbuilder provides a DSL for generating JSON. It includes a template engine which allows you to create complex responses with helpers and conditions. (8 minutes)
The Rails API Gem
Episode #348May 09, 201274 comments

The Rails API Gem

It is often asked: Is Rails a good fit if I only need to serve an API? In this episode I show how to use the Rails API gem to create a slimmer Rails application designed to respond with JSON. (9 minutes)
DataTables
Episode #340Apr 11, 2012173 comments

DataTables

DataTables makes it easy to convert a plain HTML table into one with pagination, sorting, and searching - all done with JavaScript and jQuery. Here I show how to set this up and use a Rails application as the data source. (9 minutes)
Passing Data to JavaScript
Episode #324Feb 13, 201277 comments

Passing Data to JavaScript

There are a variety of ways to pass variables from a Rails application to JavaScript. Here I show three techniques: a script tag, a data attribute, and the Gon gem. (6 minutes)
In-Place Editing
Episode #302Nov 28, 201197 comments

In-Place Editing

Edit an attribute in-place without leaving a page using the Best In Place gem. Learn how to add validations and support for various field types. (8 minutes)
Token Fields
Episode #258Mar 21, 2011118 comments

Token Fields

With the jQuery Tokeninput plugin it is easy to add an autocompleting list of entries for a many-to-many association. (11 minutes)