我user_mailer.rb:什麼是可從user_mailer.html.erb訪問的變量?
class UserMailer < ActionMailer::Base
default :from => "[email protected]"
def welcome_email(user)
@user = user
@url = "http://example.com/login"
mail(:to => user.email,:subject => "Welcome to My Awesome Site") do |format|
format.html
end
end
end
這是我user_mailer.html.erb看起來像:
<!DOCTYPE html>
<html>
<body>
<%= yield %>
</body>
</html>
我能在user_mailer.html.erb訪問。 我在哪裏需要定義的環境變量,這樣我可以在這裏訪問它?