I make it work by writing this in the Javascript part of the page:
$("#model_subset_array").val( <%= @model.subset_array %> );
Mine looks more like following:
$("#modela_modelb_ids").val( <%= @modela.modelb_ids %> );
Not sure if this is going to get me headache in the future but now it works fine.