diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-04 11:45:53 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-04 11:45:53 -0700 |
commit | 1ce0cc0d38c9f5058cb484612fab625db823c4e4 (patch) | |
tree | 7c856d0c2f6534c349ff2e81a01046acaa868c31 /guides | |
parent | 3f7e482aed8f67137c6c8382f6c558d7e856b341 (diff) | |
parent | b8f586a094c104006d29a87fee0d8b48d0af2d14 (diff) | |
download | rails-1ce0cc0d38c9f5058cb484612fab625db823c4e4.tar.gz rails-1ce0cc0d38c9f5058cb484612fab625db823c4e4.tar.bz2 rails-1ce0cc0d38c9f5058cb484612fab625db823c4e4.zip |
Merge branch 'master' of github.com:rails/rails
* 'master' of github.com:rails/rails:
For our build, stick with mail 2.5.x for now
Correct result, previously showing wrong result
Collapse PG default extractoin of most types to single regex
Change wording of explanation about precision & scale of decimal numbers [ci skip]
Cleaned up duplicated CHANGELOG entry [ci skip]
reuse available belongs_to? method
Convert StrongParameters cache to a hash. This fixes an unbounded memory leak demonstrated on @tenderlove's latest blog post:
Partially revert deprecation of *_filter
Pluralize params
Add default_i18n_subject to the guides
Fix regression on eager loading association based on SQL query rather than existing column.
Relax mail gem constraint from ~> 2.5.4 to ~> 2.5, >= 2.5.4
Keep column defaults in type cast form
Return a null column when no column exists for an attribute
Refactor XML serializer to not depend on `serialized_attributes`
Test the serialized types of virtual columns in XML
implement ActiveRecord::Base#pretty_print + changelog
Remove duplicated HashWithIndifferentAccess#with_indifferent_access.
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/i18n.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/guides/source/i18n.md b/guides/source/i18n.md index 0eba3af6e8..8340d6807f 100644 --- a/guides/source/i18n.md +++ b/guides/source/i18n.md @@ -860,6 +860,24 @@ en: subject: "Welcome to Rails Guides!" ``` +To send parameters 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. |