下一次我收到邀请函:

class InvitationMailer < ActionMailer::Base
  default :from => "[email protected]"
  def invitation_friends(invitation, user)
   @user = user
   @invitation = invitation
   mail(:bcc => @invitation.recipients.map(&:recipients), :subject => "Subject email")
  end
end

@invitation.recipients是一个包含以下电子邮件的数组:
 ["[email protected]","[email protected]"]

但我在下一次登录时:
NoMethodError (undefined method `recipients' for "[email protected]":String):

我做错什么了?
谢谢您!

最佳答案

尝试@invitations.recipients.join("; ")
您正试图对数组中的字符串对象调用:recipients,但该对象无法工作。

10-06 08:43