我有一个邮件BetaInviteMailer
,其中包含操作beta_invite
,参与name
和email
参数如下:
class BetaInviteMailer < ApplicationMailer
def beta_invite(name, email)
mail to: email, subject: 'Invitation to my closed bèta'
@name = name
end
end
beta_invite.html.erb
读取:
Dear <%= @name %>,
...
在控制台中运行BetaInviteMailer.beta_invite("John Doe", "email@email.com")
变量@name
出现了&#39; nil&#39;
我做错了什么?
答案 0 :(得分:1)
$(".add-btn").click(function() {
var $li = $(this).toggleClass("hide-me added");
var $wrap = $li.closest('.label-wrap');
$wrap.find('h1').toggleClass('top-added', $wrap.find('.added').length > 0)
});
在邮件调用之前定义@variable