Accessing local HTML5 storage from a Rails application

Is there a way to access HTML5 local storage from Ruby on Rails application? If there is a gem / javascript library (excluding backbone.js because it is too hard to rewrite an existing application using this) please give me a link and a good tutorial. And if you have your own code that solves this problem, I'll be happy too :) Thanks!

+3


source to share


1 answer


As far as I know, localStorage is a pure Javascript / HTML5 feature. has nothing to do with rails

In your javascript application, you can use the following to read or write data from local storage:



$('.add-hotel').click(function(){ 
item = localStorage.getItem('bucket_data');
});

      

+1


source







All Articles