ActionDispatch SessionRestoreError

I am in a SessionInfo trouble.

error message is
ActionDispatch::Session::SessionRestoreError (Session contains objects
whose class definition isn’t available.
Remember to require the classes for all objects kept in the session.
(Original exception: uninitialized constant SessionInfo [NameError])

my first ajax call is using flexigrd to rails, this is
SessionRestoreError.
my second ajax call is using jquery using ajax to rails. this is
somtimes work, sometime doesn’t work.

I use rails3.0.9, ruby1.9.2, jqeury, flexigrid and os is ubunt.

how do I make ajax call?


//view
// first ajax

var csrfparam = $("meta[name='csrf-param']").attr("content"); var csrftoken = $("meta[name='csrf-token']").attr("content"); $(function() { $(document).ajaxSend(function(e, xhr, options) { var token = $("meta[name='csrf-token']").attr("content"); xhr.setRequestHeader("X-CSRF-Token", token); }); $("#group_flex1").flexigrid({ url: url_group_grid, dataType: 'json', singleSelect: true, colModel : [ {display: 'id', name : 'id', width : 30, sortable : true, align: 'left', hide: true}, // snip ], // snip params : [ { name : '<%= :search_group_kbn.to_s %>', value : '<%= @search_group_kbn %>'}, { name : '<%= :search_mbr_kind_kbn.to_s %>', value : '<%= @search_mbr_kind_kbn %>'}, { name : '<%= :search_group_name.to_s %>', value : '<%= @search_group_name %>'}, { name : '<%= :search_rep_familyname.to_s %>', value : '<%= @search_rep_familyname %>'}, { name : '<%= :search_valid_chk.to_s %>', value : $ ('#search_valid_chk').attr('checked')}, { name : '<%= :group_action.to_s %>', value : '<%= session[:group_action].to_s %>'}, { name : '_method', value : 'POST'}, { name : csrfparam, value : csrftoken}], preProcess: procLink } ); ------------------ //view // second ajax <%= csrf_meta_tag %> // snip $(function() { $(document).ajaxSend(function(e, xhr, options) { var token = $("meta[name='csrf-token']").attr("content"); xhr.setRequestHeader("X-CSRF-Token", token); }); $(window).load(function() { $.ajax({url: '<%= url_for :controller => "events", :action => "index2" %>' , success: function(html){$ ("#events_all_list").append(html);}}); });

On Nov 11, 5:08am, shon [email protected] wrote:

my second ajax call is using jquery using ajax to rails. this is
somtimes work, sometime doesn’t work.

I use rails3.0.9, ruby1.9.2, jqeury, flexigrid and os is ubunt.

how do I make ajax call?

This has almost certainly nothing to do with ajax or your javascript
but with what you are storing in your session. In general, storing
complex objects in the session is a bad idea. As the error message
says, if you do go down this down you’ll need to ensure that the the
classes for objects that might be in the session are already loaded.

Fred

HI I’m shon.
Your advice is right. i changed the session to be simple. then it
works fine.

Thank you.