Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

helper :all for ActionMailer

#1119

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)

Reported by Darragh Curran · September 26th, 2008 @ 12:26 PM

State: wontfix
Milestone: 3.0.2
Assigned to: Pratik Pratik
Importance: Medium

Activity

  1. Pratik
    Pratik
    • Milestone cleared.
    • Assigned user set to Yehuda Katz (wycats)

    January 5th, 2009 @ 05:58 PM

  2. javan (at javan)
  3. Pratik
    Pratik
    • 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 !

    May 18th, 2009 @ 07:54 PM

  4. Darragh Curran
    Darragh Curran

    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.

    Cheers,
    Darragh

    May 20th, 2009 @ 07:46 AM

  5. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Medium

    October 15th, 2010 @ 11:01 PM

  6. swindsor
    swindsor

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

    December 29th, 2010 @ 01:15 AM

  7. bingbing