我得到错误:
index -7 out of array
我的阵列有什么问题?我不能存储太多数字,还是什么?
更新
PS - (从 json 我只得到 ids)
answers_from_json = ActiveSupport::JSON.decode(params[:answers_from_json])
answers_from_json.each_with_index do |item, i|
posts = Post.find(:all, :conditions => ["id=?",item.to_i])
sheet[header_y_offset-1,0] = 'Name'
posts.each_with_index do |post,i|
sheet[1+i,0] = post.name
end
end