प्रलेखन में यह कहता है कि मेलर क्रियाएं नियंत्रक क्रियाओं के समान ही फैशन में व्यवहार करती हैं। रेल गाइड में, मेल भेजने के लिए:रेल 3 एक्शनमेलर किस प्रारूप का उपयोग करने का निर्णय लेता है?
UserMailer.welcome_email(@user).deliver
और welcome_email कार्रवाई इस तरह दिखता है:
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 { render 'another_template' }
format.text { render 'another_template' }
end
end
कि मैं क्या नहीं मिलता है कैसे welcome_email कार्रवाई जो प्रारूप का उपयोग करने का फैसला करता है, (HTML या पाठ)?
धन्यवाद!