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 2012-01-13 13:07:38