This project is archived and is in readonly mode.

#1119 ✓wontfix
Darragh Curran

helper :all for ActionMailer

Reported by Darragh Curran | September 26th, 2008 @ 12:26 PM | in 3.0.2

in controllers you can do helper :all and it will include all helpers in /app/helpers

but currently mailers don't allow the :all option (actually it will just look for helper called AllHelper

this patch adds support for helper :all to ActionMailer

In order to keep this patch simple - I haven't attempted to remove the obvious duplication between helper.rb in ActionMailer and ActionPack - but there's a good oppurtunity to do so (I reckon it's best to allow rails core to do as they see fit)

Comments and changes to this ticket

  • Pratik

    Pratik January 5th, 2009 @ 05:58 PM

    • Milestone cleared.
    • Assigned user set to “Yehuda Katz (wycats)”
  • javan (at javan)
  • Pratik

    Pratik May 18th, 2009 @ 07:54 PM

    • Assigned user changed from “Yehuda Katz (wycats)” to “Pratik”
    • State changed from “new” to “wontfix”

    I don't think helper :all has any real value for Mailers. I've never come across a case where I'd want to include all my helpers in mailers as they're typically tied to request/response cycle.

    However, you might want to drop an email to the rails core mailing list and see if others find this useful. In which case we can reevaluate the patch.

    Thanks !

  • Darragh Curran

    Darragh Curran May 20th, 2009 @ 07:46 AM

    No problem.

    For me, the value for helper :all was on a reasonably small app, with a few html emails. Some of my mailers were adding nearly all the helpers. I haven't missed it since!

    I'd suggest that the value is similar to using helper :all in a controller - how is that justified? (I do respect that some helper methods are request/response dependent, but similarly some may be particular to the context of mailers).

    There's an opportunity to extract the duplication wrt helpers out of action_controller/action_mailer, the value there is consistency (in code/tests/documentation). I reckon it's accidental that helper :all doesn't exist in mailers.

    Let me know if you'd like me to submit a patch that attempts to resolve the duplication and inconsistency.


  • Jeremy Kemper

    Jeremy Kemper October 15th, 2010 @ 11:01 PM

    • Milestone set to 3.0.2
    • Importance changed from “” to “Medium”
  • swindsor

    swindsor December 29th, 2010 @ 01:15 AM

    Actually, this would be really useful for me. It seems odd and broken that this exists for ActionController, but not ActionMailer.

  • bingbing

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>