RailsCasts

#324 Passing Data to JavaScript

02.13.2012 - By Ryan BatesPlay

Download our free app to listen on your phone

Download on the App StoreGet it on Google Play

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.

More episodes from RailsCasts