Refer below link http://lindsaar.net/2008/2/21/history-buttons-with-ajax-and-ruby-on-rails and use the code window.dhtmlHistory.create({ toJSON: function(o) { return JSON.stringify(o); } , fromJSON: function(s) { return JSON.parse(s); } }); instead of window .dhtmlHistory.create({ toJSON: function (o) { return Object .toJSON(o); }, fromJSON: function (s) { return s.evalJSON(); } }); on that post Happy learning
Error :- down_retry_delay not reached for localhost:11211 (0.001 seconds left) down_retry_delay not reached for localhost:11211 (0.001 seconds left) down_retry_delay not reached for localhost:11211 (0.001 seconds left) down_retry_delay not reached for localhost:11211 (0.001 seconds left) [2012-03-20 15:08:28] ERROR NoMethodError: You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.6/lib/rack/handler/webrick.rb:71:in `service' /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service' /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run' /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread' cache: [GET /assets/kanga_custom/search_merchant.js?body=1] miss, ...
By using each_slice we can convert single dimension array in to multi dimention array foo . each_slice ( 3 ). to_a #=> [["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"], ["10"]]