0
ユーザーが空白を入力した後、私のメールに情報を形成したい。しかし、ユーザーのモデル属性を自分のメールアドレスにHTML形式で送ることはできません。Rails 3 ActionMailerモデル属性
class DemandMailer < ActionMailer::Base
default from: "[email protected]"
def demand_call(demand)
mail(:to => "[email protected]" , :subject => "user registered")
end
end
とdemand_call.html.erbはその
the user name is <%= @demand.name %>
のようですが、エラーが、私はそれを解決する方法を
ActionView::Template::Error (undefined method `name' for nil:NilClass):
のですか?
内でそれを使用することができますよりも、あなたは方法
内のインスタンス変数を定義する必要があります。 – ndrx42