Arkadey
Arkadey

Reputation: 31

Accessing HTML5 Local Storage from Rails app

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

Upvotes: 3

Views: 5222

Answers (1)

Jai Kumar Rajput
Jai Kumar Rajput

Reputation: 4207

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

You can use the following in you application javascript in order to read or write data from the local storage:

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

Upvotes: 3

Related Questions