Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstorimer/517669 to your computer and use it in GitHub Desktop.
Save jstorimer/517669 to your computer and use it in GitHub Desktop.
gem i rails -v=2.3.10
rails broken-helper-all
cd broken-helper-all
./script/generate scaffold article
./script/generate scaffold product
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
end
# app/helpers/articles_helper.rb
module ArticlesHelper
def foo(a); end
end
# app/helpers/products_helpers.rb
def ProductsHelper
def foo(a,b); end
end
# app/views/articles/index.html.erb
<%= foo('bar') %>
rake test:functionals #=> ArgumentError: wrong number of arguments (1 for 2)
gem i rails -v=3.0.1
rails new broken-helper-all
cd broken-helper-all
bundle install
rails g controller articles index
rails g controller products index
# helper :all is now the framework default and defined in ActionController::Base
# app/helpers/articles_helper.rb
module ArticlesHelper
def foo(a); end
end
# app/helpers/products_helpers.rb
module ProductsHelper
def foo(a,b); end
end
# app/views/articles/index.html.erb
<%= foo('bar') %>
rake test:functionals #=> ArgumentError: wrong number of arguments (1 for 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment