0

このメソッドが空の変数、したがって空の本体を生成するのはなぜですか?

custom_email.text.erb

<%=@message%>

user_mailer.rb

default from: "Name <name@domain.com>"
def custom_email(email, subject, message)
  mail to: email, subject: "Name || #{subject}"
  @message = message
end

この方法が機能している間:

mail to: email, subject: "Name || #{subject}", body: message
4

1 に答える 1

1

これを書く

default from: "Name <name@domain.com>"
def custom_email(email, subject, message)
  @message = message
  mail to: email, subject: "Name || #{subject}"
end

それ以外の

default from: "Name <name@domain.com>"
def custom_email(email, subject, message)
  mail to: email, subject: "Name || #{subject}"
  @message = message
end

次に @message を考慮します

于 2013-06-11T10:51:45.700 に答える