diff options
author | Xavier Noria <fxn@hashref.com> | 2014-11-23 13:53:01 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2014-11-24 14:33:50 -0800 |
commit | 9685080a7677abfa5d288a81c3e078368c6bb67c (patch) | |
tree | 09b3fe1061211ef557cede731794a4bd0ccfcf9e /actionpack/lib | |
parent | cdd90f39d796986dabf1678b3277b230dbe18961 (diff) | |
download | rails-9685080a7677abfa5d288a81c3e078368c6bb67c.tar.gz rails-9685080a7677abfa5d288a81c3e078368c6bb67c.tar.bz2 rails-9685080a7677abfa5d288a81c3e078368c6bb67c.zip |
let mailer templates generate URLs by default [Xavier Noria, Richard Schneeman]
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 8 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/routing/url_for.rb | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index a641ea3ea9..d2ae2a496f 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -457,7 +457,7 @@ module ActionDispatch RUBY end - def url_helpers(include_path_helpers = true) + def url_helpers(supports_path = true) routes = self Module.new do @@ -484,7 +484,7 @@ module ActionDispatch # named routes... include url_helpers - if include_path_helpers + if supports_path path_helpers = routes.named_routes.path_helpers_module else path_helpers = routes.named_routes.path_helpers_module(true) @@ -502,6 +502,10 @@ module ActionDispatch # UrlFor (included in this module) add extra # conveniences for working with @_routes. define_method(:_routes) { @_routes || routes } + + define_method(:_generate_paths_by_default) do + supports_path + end end end diff --git a/actionpack/lib/action_dispatch/routing/url_for.rb b/actionpack/lib/action_dispatch/routing/url_for.rb index eb554ec383..dca86858cc 100644 --- a/actionpack/lib/action_dispatch/routing/url_for.rb +++ b/actionpack/lib/action_dispatch/routing/url_for.rb @@ -184,6 +184,12 @@ module ActionDispatch def _routes_context self end + + private + + def _generate_paths_by_default + true + end end end end |