2004-12-09 10:54:22 -05:00
|
|
|
GENERATOR
|
|
|
|
mailer - create mailer and view stub files
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
SYNOPSIS
|
2004-12-09 10:54:22 -05:00
|
|
|
generate mailer MailerName action [action ...]
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
DESCRIPTION
|
2004-12-09 10:54:22 -05:00
|
|
|
The mailer generator takes the name of the new mailer class as the
|
2004-11-23 20:04:44 -05:00
|
|
|
first argument and a variable number of mail action names as subsequent
|
|
|
|
arguments.
|
|
|
|
|
2004-12-09 10:54:22 -05:00
|
|
|
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.
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
EXAMPLE
|
2004-12-09 10:54:22 -05:00
|
|
|
./script/generate mailer Notifications signup forgot_password invoice
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
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.
|