Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source
Show
Ignore:
Timestamp:
01/26/08 08:41:19 (9 months ago)
Author:
nzkoz
Message:

Make it simpler to make the root route an alias for another route. Closes #10818 [bscofield]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/routing/route_set.rb

    r8674 r8738  
    2020        # Creates a named route called "root" for matching the root level request. 
    2121        def root(options = {}) 
     22          if options.is_a?(Symbol) 
     23            if source_route = @set.named_routes.routes[options] 
     24              options = source_route.defaults.merge({ :conditions => source_route.conditions }) 
     25            end 
     26          end 
    2227          named_route("root", '', options) 
    2328        end