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 from ActionMailer

#6575

The documentation for AbstractController::Helpers#helper states that :all is a special parameter.

Indeed, from a ActionController::Base, helper :all will use all the helper files. It even does that by default in Rails 3.

On the other hand, this doesn't work from ActionMailer::Base and we get:

Missing helper file helpers/all_helper.rb

Note that ActionMailer::Base < AbstractController::Helpers is true.

1) It would be nice if helper :all could work for ActionMailer::Base also.

2) If it did, maybe ActionMailer::Base should call it by default, as ActionController does

3) If it wont, and :all can not handled by all descendants of AbstractController::Helpers, then the doc should be updated to reflect this.

Thanks

Reported by Marc-André Lafortune · March 14th, 2011 @ 05:12 PM

State: open
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. ifesdjeen
    ifesdjeen

    :all is handled by overwritten helper (actionpack/lib/action_controller/metal/helpers.rb), which overwrites modules_for_helpers to

        def modules_for_helpers(args)
           args += all_application_helpers if args.delete(:all)
           super(args)
        end
    

    What most likely happened, that method doesn't get loaded.
    If someone from Rails team could explain a bit of background behind that situation, I could provide a patch.
    Thanks

    Edited by Rohit Arondekar for formatting.

    March 19th, 2011 @ 12:04 PM

  2. ifesdjeen
    ifesdjeen

    For some reason my code got all messy, please see it in that gist: https://gist.github.com/877432

    March 19th, 2011 @ 12:05 PM

  3. Neeraj Singh
    Neeraj Singh
    • State changed from new to open
    • Assigned user set to José Valim
    • Importance changed from to Low

    Fix is here. Please see last two commits.

    https://github.com/neerajdotname/rails/commits/fix_for_6575

    April 9th, 2011 @ 05:51 PM