cache_digests
cache_digests copied to clipboard
ActionMailer undefined method `perform_caching'
It is impossible to include a partial with cache into email to be sent using ActionMailer.
ActionView::Template::Error (undefined method `perform_caching' for #<ContactMailer:0x007f8dc14f5578>):
1: <% cache [object, admin?] do %>
...
So I have added a helper to the mailer:
helper_method :cache
def cache *args
yield
end
But this seems a bit half-assed.
https://github.com/nhocki/cache_digests/commit/ce2fe2531017b19b05b0115350367d31b8a8902d
If using rails 4.2 look at https://github.com/rails/rails/issues/17657#issuecomment-71385191