Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/55.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 未在Rails 4.0和Ruby 2.0中创建对虾表_Ruby On Rails_Ruby_Prawn - Fatal编程技术网

Ruby on rails 未在Rails 4.0和Ruby 2.0中创建对虾表

Ruby on rails 未在Rails 4.0和Ruby 2.0中创建对虾表,ruby-on-rails,ruby,prawn,Ruby On Rails,Ruby,Prawn,我有下表代码: 成员id和名字、nps分数和评论=[[“14169021-00”, “克里斯”,9岁,“佛罗里达州坦帕地区的基督教青年会太棒了。我想 请参见对其他运动项目的支持水平 打壁球有很多种 为活动提供服务,有许多方便的地点 我喜欢这里的员工 但是阵雨很严重,[“16257833-00”,“菲利斯”,10,“A 舒适的环境,一个可以与人见面的地方 重要的是,工作人员随时待命。”]、[“1629846-00”、“Joan”, 10,“成本、距离、家庭友好”],[“16204559-00”,“

我有下表代码:

成员id和名字、nps分数和评论=[[“14169021-00”, “克里斯”,9岁,“佛罗里达州坦帕地区的基督教青年会太棒了。我想 请参见对其他运动项目的支持水平 打壁球有很多种 为活动提供服务,有许多方便的地点 我喜欢这里的员工 但是阵雨很严重,[“16257833-00”,“菲利斯”,10,“A 舒适的环境,一个可以与人见面的地方 重要的是,工作人员随时待命。”]、[“1629846-00”、“Joan”, 10,“成本、距离、家庭友好”],[“16204559-00”,“Lisa Marie”, 5.“设施相当拥挤,这使得在 设备或参加狭窄和困难的课程。”], [“16258576-00”,“Michael”,7,“他花了很多钱\r\n”], [“16161644-00”,“四月”,10,“],[“1663157-00”,“玛丽拉”,10,“伟大 客户服务、清洁设施和专业人员”], [“16114120-00”,“Alison”,10,“Y提供了很棒的节目,而且 活跃于当地社区 这是一个适合一切的地方。这是一个健身、友谊的地方, 社会化、社区化、青年向上发展、就业 opps…]]


仅使用标题行(
成员ID、名字等)生成表。
)。列中未填充实际的
成员\u id\u和\u first\u name\u和\u nps\u score\u和\u comments
数组

想知道为什么会这样吗?

试试:

table([
    ["Member ID", "First Name", "NPS Score", "Comments"],
    *member_id_and_first_name_and_nps_score_and_comments.reject{ |x| x[2].nil? }
  ], 
  :position => :center, :column_widths => {0 => 50, 1 => 60, 2 => 45, 3 => 285}) do
    row(0).style :background_color => 'C0C0C0'
  end

member\u id\u and\u first\u name\u and\u nps\u score\u and\u comments
-这可能是我迄今为止见过的最长的变量名。请解释一下你想用什么:
[member\u id\u and\u first\u name\u and\u nps\u score\u and\u comments]。转置。拒绝{x | x[2]。无?}
-这几乎肯定是不对的。是否要显示nps分数不为零的所有数据?即,splat运算符和转置已关闭。谢谢
table([
    ["Member ID", "First Name", "NPS Score", "Comments"],
    *member_id_and_first_name_and_nps_score_and_comments.reject{ |x| x[2].nil? }
  ], 
  :position => :center, :column_widths => {0 => 50, 1 => 60, 2 => 45, 3 => 285}) do
    row(0).style :background_color => 'C0C0C0'
  end