Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helper :all from ActionMailer #1582

Closed
marcandre opened this issue Jun 8, 2011 · 7 comments
Closed

helper :all from ActionMailer #1582

marcandre opened this issue Jun 8, 2011 · 7 comments

Comments

@marcandre
Copy link
Contributor

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 / 3.1rc1.

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.

Comments to be found in the imported issue

@arunagw
Copy link
Member

arunagw commented Dec 8, 2011

@marcandre Not sure if this is still a issue. can you please confirm???

@arunagw
Copy link
Member

arunagw commented Dec 27, 2011

Closing this. Please feel free to reopen it again if issue still exists for you.

Thanks!

@arunagw arunagw closed this as completed Dec 27, 2011
@JayTeeSF
Copy link

JayTeeSF commented Dec 7, 2012

This is still an issue:
I'm on OSX running:
Ruby 1.9.3-p194 (w/ Falcon memory mgmt patch)
Rails 3.1.4 and Rails 3.2.9

my_mailer.rb
class MyMailer < ActionMailer::Base
helper :all
end

my_mailer_spec.rb
require 'spec_helper'
describe MyMailer do

end

↪ rspec ./spec/mailers/my_mailer_spec.rb
/Users/jthomas/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:306:in `rescue in depend_on': Missing helper file helpers/all_helper.rb (LoadError)

as well as:

/Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:317:in `rescue in depend_on': Missing helper file helpers/all_helper.rb

FWIW, here are the rest of the gory details:
(LoadError) from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:312:in depend_on' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:225:inrequire_dependency' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/actionpack-3.2.9/lib/abstract_controller/helpers.rb:135:in block in modules_for_helpers' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/actionpack-3.2.9/lib/abstract_controller/helpers.rb:131:inmap!' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/actionpack-3.2.9/lib/abstract_controller/helpers.rb:131:in modules_for_helpers' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/actionpack-3.2.9/lib/abstract_controller/helpers.rb:95:inhelper' from /Users//dev/test/www/app/mailers/my_mailer.rb:8:in <class:MyMailer>' from /Users/<username>/dev/test/www/app/mailers/my_mailer.rb:4:in<top (required)>' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in require' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:inblock in require' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in load_dependency' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:inrequire' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:359:in require_or_load' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:313:independ_on' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:225:in require_dependency' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/engine.rb:439:inblock (2 levels) in eager_load!' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/engine.rb:438:in each' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/engine.rb:438:inblock in eager_load!' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/engine.rb:436:in each' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/engine.rb:436:ineager_load!' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/application/finisher.rb:53:in block in <module:Finisher>' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/initializable.rb:30:ininstance_exec' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/initializable.rb:30:in run' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/initializable.rb:55:inblock in run_initializers' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/initializable.rb:54:in each' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/initializable.rb:54:inrun_initializers' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/application.rb:136:in initialize!' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:inmethod_missing' from /Users//dev/test/www/config/environment.rb:5:in <top (required)>' from /Users/<username>/dev/test/www/spec/spec_helper.rb:28:inrequire' from /Users//dev/test/www/spec/spec_helper.rb:28:in block in <top (required)>' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/spork-1.0.0rc2/lib/spork.rb:24:inprefork' from /Users//dev/test/www/spec/spec_helper.rb:7:in <top (required)>' from /Users/<username>/dev/test/www/spec/mailers/my_mailer_spec.rb:4:inrequire' from /Users//dev/test/www/spec/mailers/my_mailer_spec.rb:4:in <top (required)>' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:inload' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in block in load_spec_files' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:inmap' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in load_spec_files' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:inrun' from /Users//.rvm/gems/ruby-1.9.3-p194-perf@www/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in run' from /Users/<username>/.rvm/gems/ruby-1.9.3-p194-perf@www/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:inblock in autorun'

@phillbaker
Copy link
Contributor

👍 this is a confusing difference.

@rafaelfranca rafaelfranca reopened this May 28, 2013
@phillbaker
Copy link
Contributor

@rafaelfranca thanks for re-opening.

It looks like #928 is the same issue, imported from Lighthouse and @neerajdotname had a fix mentioned in the comments at https://github.com/neerajdotname/rails/commits/fix_for_6575, but that link is now 404ing. Maybe he can resurrect that branch?

@neerajsingh0101
Copy link

@phillbaker I remember having worked on it. I don't have that fix locally too. I'll work on it.

arunagw added a commit to arunagw/rails that referenced this issue Jun 14, 2013
@josevalim
Copy link
Contributor

I honestly can't see the appeal on including helper :all on ActionMailer even because it will include a bunch of unrelated helpers into the mailer. As @arunagw pull requests shows, all you need to do is to include ActionController::Helpers functionality into your mailer, so you can just go ahead and do it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants