diff options
author | Stan Lo <a22301613@yahoo.com.tw> | 2016-02-25 00:36:41 +0800 |
---|---|---|
committer | Stan Lo <a22301613@yahoo.com.tw> | 2016-02-25 00:36:41 +0800 |
commit | f7ce370e602eadf44e3367d853baa8fde66bdb02 (patch) | |
tree | 25539ce7cd1b717897f8395f282b44d1e5885c6f /guides | |
parent | bebd9086c88d43bb0132c309abddd3a2e6ba8852 (diff) | |
download | rails-f7ce370e602eadf44e3367d853baa8fde66bdb02.tar.gz rails-f7ce370e602eadf44e3367d853baa8fde66bdb02.tar.bz2 rails-f7ce370e602eadf44e3367d853baa8fde66bdb02.zip |
Add caching guide in ActionMailer basics
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/action_mailer_basics.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index 91ea4efb55..558c16f5b0 100644 --- a/guides/source/action_mailer_basics.md +++ b/guides/source/action_mailer_basics.md @@ -407,6 +407,22 @@ use the rendered text for the text part. The render command is the same one used inside of Action Controller, so you can use all the same options, such as `:text`, `:inline` etc. +#### Caching mailer view + +You can do cache in mailer views like in application views using `cache` method. + +``` +<% cache do %> + <%= @company.name %> +<% end %> +``` + +And in order to use this feature, you need to configure your application with this: + +``` + config.action_mailer.perform_caching = true +``` + ### Action Mailer Layouts Just like controller views, you can also have mailer layouts. The layout name |