Skip to content
  • Andrew White's avatar
    2ff49338
    Allow engine root relative redirects using an empty string. · 2ff49338
    Andrew White authored
    Example:
    
        # application routes.rb
        mount BlogEngine => '/blog'
    
        # engine routes.rb
        get '/welcome' => redirect('')
    
    This now redirects to the path `/blog`, whereas before it would redirect
    to the application root path. In the case of a path redirect or a custom
    redirect if the path returned contains a host then the path is treated as
    absolute. Similarly for option redirects, if the options hash returned
    contains a `:host` or `:domain` key then the path is treated as absolute.
    
    Fixes #7977
    
    (cherry picked from commit b64bac48)
    2ff49338
    Allow engine root relative redirects using an empty string.
    Andrew White authored
    Example:
    
        # application routes.rb
        mount BlogEngine => '/blog'
    
        # engine routes.rb
        get '/welcome' => redirect('')
    
    This now redirects to the path `/blog`, whereas before it would redirect
    to the application root path. In the case of a path redirect or a custom
    redirect if the path returned contains a host then the path is treated as
    absolute. Similarly for option redirects, if the options hash returned
    contains a `:host` or `:domain` key then the path is treated as absolute.
    
    Fixes #7977
    
    (cherry picked from commit b64bac48)
Loading