Skip to content

Instantly share code, notes, and snippets.

@rorcraft
Created October 11, 2013 19:01
Show Gist options
  • Save rorcraft/6940242 to your computer and use it in GitHub Desktop.
Save rorcraft/6940242 to your computer and use it in GitHub Desktop.
module ActionController
module Railties
module Paths
def self.with(app)
Module.new do
define_method(:inherited) do |klass|
super(klass)
if namespace = klass.parents.detect { |m| m.respond_to?(:railtie_helpers_paths) }
paths = namespace.railtie_helpers_paths
else
paths = app.helpers_paths
end
klass.helpers_path = paths
if klass.superclass == ActionController::Base && ActionController::Base.include_all_helpers
klass.helper :all
end
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment