USAGE 1.1 KB
Newer Older
1 2
GENERATOR
     mailer - create mailer and view stub files
D
Initial  
David Heinemeier Hansson 已提交
3 4

SYNOPSIS
5
     generate mailer MailerName action [action ...]
D
Initial  
David Heinemeier Hansson 已提交
6 7

DESCRIPTION
8
     The mailer generator takes the name of the new mailer class as the
D
Initial  
David Heinemeier Hansson 已提交
9 10 11
     first argument and a variable number of mail action names as subsequent
     arguments.

12 13 14 15
     Mailer generates a class file in app/models with action methods for each
     of the mail action names passed, a test suite in test/unit with a stub
     test case and fixture per action, and template stubs for each action in
     app/views under a directory with the same name as the class.
D
Initial  
David Heinemeier Hansson 已提交
16 17

EXAMPLE
18
     ./script/generate mailer Notifications signup forgot_password invoice
D
Initial  
David Heinemeier Hansson 已提交
19 20 21 22 23 24 25 26 27

     This will generate a Notifications class in
     app/models/notifications.rb, a NotificationsTest in
     test/unit/notifications_test.rb, and signup, forgot_password, and invoice
     in test/fixture/notification. It will also create signup.rhtml,
     forgot_password.rhtml, and invoice.rhtml in app/views/notifications.
     
     The Notifications class will have the following methods: signup,
     forgot_password, and invoice.