mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make UrlWriter includable in a Module
This commit is contained in:
parent
63bb955a99
commit
fd567785f4
1 changed files with 9 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
require 'active_support/core_ext/class/attribute'
|
||||
require 'active_support/core_ext/module/attribute_accessors'
|
||||
|
||||
module ActionController
|
||||
# In <b>routes.rb</b> one defines URL-to-controller mappings, but the reverse
|
||||
|
@ -87,7 +88,14 @@ module ActionController
|
|||
|
||||
included do
|
||||
ActionController::Routing::Routes.install_helpers(self)
|
||||
class_attribute :default_url_options
|
||||
|
||||
# Including in a class uses an inheritable hash. Modules get a plain hash.
|
||||
if respond_to?(:class_attribute)
|
||||
class_attribute :default_url_options
|
||||
else
|
||||
mattr_accessor :default_url_options
|
||||
end
|
||||
|
||||
self.default_url_options = {}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue