我有以下哈希数组,我需要解析所有不为空的电子邮件:
[{:id=>"something", :first_name=>"First", :last_name=>"Name", :name=>"First Name", :email=>"first_name@gmail.com", :gender=>nil, :birthday=>nil, :profile_picture=>nil, :relation=>nil},
{...},
{}]
我正在尝试这样做:
- @contacts[0].each_with_index do |c, i|
- unless c[:email].blank?
%tr
%td= c[:email]
%td= check_box_tag "email_to[]", c[:email], true
但我收到错误:
An ActionView::Template::Error occurred in users#parse_data:
no implicit conversion of Symbol into Integer
怎么做才对?