Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将两个用户(@to_whom 和 @from_whom)从控制器传递给邮件程序。我只能通过一个,例如:
UserMailer.invitation_email(@to_whom).deliver
谢谢。
您可以传递多个参数:
UserMailer.invitation_email(@to_whom, @from_whom).deliver
只需确保您的invitation_email方法设置为接受所有参数:
invitation_email
def invitation_email(to_whom, from_whom) ... end