As far as I know localStorage has nothing to do with Rails, it is pure Javascript/HTML5 feature.
You can use the following in you application js in order to read or write data from the local storage:
var foo = localStorage.getItem("bar");
localStorage.setItem("bar", foo);