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"]]
I used the script <script type = "text/javascript"> function closeWindow(){ window.open('','_self',''); window.close(); } </script> this works well with IE (it overrides prompt) and chrome but is not working with Firefox as by default Firefox don't allow to close tab using JavaScript It is needed to follow these steps in Firefox 1. Go to address bar and type about:config 2. Go to parameter dom.allow_scripts_to_close_windows 3. Set its value as true
rails if we make zip_code as integer value in database it will not gives the zip_code validations when we give zip_code as 01234 it takes as 1234 like all prefix zeros solution:- we have to to make zip_code as string then it will validates zip_code properly to all zip_codes like 01234