diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-29 11:50:35 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-29 14:38:01 -0800 |
commit | fb3e09a877f6b4649dff8c9fc4a991a3ac7fa3cf (patch) | |
tree | 954c8acc77a4c1b307dc7a6224cf749025d877c4 /actionpack/lib | |
parent | 72c290ca1597f2ecf3252aaa51d3baef0cac0440 (diff) | |
download | rails-fb3e09a877f6b4649dff8c9fc4a991a3ac7fa3cf.tar.gz rails-fb3e09a877f6b4649dff8c9fc4a991a3ac7fa3cf.tar.bz2 rails-fb3e09a877f6b4649dff8c9fc4a991a3ac7fa3cf.zip |
don't need the begin / end
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index fb49bc153c..22d4ccf623 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -307,33 +307,29 @@ module ActionDispatch end def url_helpers - @url_helpers ||= begin - routes = self + routes = self - helpers = Module.new do - extend ActiveSupport::Concern - include UrlFor + @url_helpers ||= Module.new { + extend ActiveSupport::Concern + include UrlFor - @_routes = routes - def self.url_for(options) - @_routes.url_for options - end + @_routes = routes + def self.url_for(options) + @_routes.url_for options + end - extend routes.named_routes.module + extend routes.named_routes.module - # ROUTES TODO: install_helpers isn't great... can we make a module with the stuff that - # we can include? - # Yes plz - JP - included do - routes.install_helpers(self) - singleton_class.send(:redefine_method, :_routes) { routes } - end - - define_method(:_routes) { @_routes || routes } + # ROUTES TODO: install_helpers isn't great... can we make a module with the stuff that + # we can include? + # Yes plz - JP + included do + routes.install_helpers(self) + singleton_class.send(:redefine_method, :_routes) { routes } end - helpers - end + define_method(:_routes) { @_routes || routes } + } end def empty? |