mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add default_i18n_subject to the guides
[ci skip]
This commit is contained in:
parent
6b6eb94bba
commit
f5ae493299
1 changed files with 18 additions and 0 deletions
|
@ -860,6 +860,24 @@ en:
|
|||
subject: "Welcome to Rails Guides!"
|
||||
```
|
||||
|
||||
To send params to interpolation use the `default_i18n_subject` method on the mailer.
|
||||
|
||||
```ruby
|
||||
# user_mailer.rb
|
||||
class UserMailer < ActionMailer::Base
|
||||
def welcome(user)
|
||||
mail(to: user.email, subject: default_i18n_subject(user: user.name))
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
```yaml
|
||||
en:
|
||||
user_mailer:
|
||||
welcome:
|
||||
subject: "%{user}, welcome to Rails Guides!"
|
||||
```
|
||||
|
||||
### Overview of Other Built-In Methods that Provide I18n Support
|
||||
|
||||
Rails uses fixed strings and other localizations, such as format strings and other format information in a couple of helpers. Here's a brief overview.
|
||||
|
|
Loading…
Reference in a new issue