Skip to content
Commits on Jan 1, 2014
  1. @pixeltrix

    Allow engine root relative redirects using an empty string.

    pixeltrix committed Jan 1, 2014
        # 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
Commits on Dec 2, 2013
  1. @pixeltrix

    Try to escape each part of a path redirect route correctly

    pixeltrix committed Dec 2, 2013
    A path redirect may contain any and all parts of a url which have different
    escaping rules for each part. This commit tries to escape each part correctly
    by splitting the string into three chunks - path (which may also include a host),
    query and fragment; then it applies the correct escape pattern to each part.
    Whilst using `URI.parse` would be better, unfortunately the possible presence
    of %{name} parameters in the path redirect string prevents us from using it so
    we have to use a regular expression instead.
    Fixes #13110.
Commits on Oct 10, 2013
  1. @pixeltrix

    Respect `SCRIPT_NAME` when using `redirect` with a relative path

    pixeltrix committed Oct 10, 2013
        # application routes.rb
        mount BlogEngine => '/blog'
        # engine routes.rb
        get '/admin' => redirect('admin/dashboard')
    This now redirects to the path `/blog/admin/dashboard`, whereas before it
    would've generated an invalid url because there would be no slash between
    the host name and the path. It also allows redirects to work where the
    application is deployed to a subdirectory of a website.
    Fixes #7977
Commits on Sep 13, 2013
  1. @suginoy
Commits on Nov 24, 2012
  1. @carlosantoniodasilva
Commits on Nov 9, 2012
  1. @carlosantoniodasilva

    Use get in the redirection doc examples

    carlosantoniodasilva committed Nov 9, 2012
    get is the most common usage, and match without an explicit verb
    was disallowed in 56cdc81.
    [ci skip]
Commits on Oct 31, 2012
  1. @AvnerCohen
Commits on May 20, 2012
  1. @pixeltrix

    Return 400 Bad Request for URL paths with invalid encoding.

    pixeltrix committed May 20, 2012
    Passing path parameters with invalid encoding is likely to trigger errors
    further on like `ArgumentError (invalid byte sequence in UTF-8)`. This will
    result in a 500 error whereas the better error to return is a 400 error which
    allows exception notification libraries to filter it out if they wish.
    Closes #4450
Commits on May 19, 2012
  1. @pixeltrix
Commits on May 18, 2012
  1. @lukaszx0

    Fix inspecting route redirections, closes #6369

    lukaszx0 committed May 18, 2012
    This commit fixes route inspection in `rake routes`
      foo  /foo(.:format) :controller#:action"
      foo  /foo(.:format)  Redirect (301)
Commits on May 3, 2012
  1. @pwim

    use extract_options!

    pwim committed May 3, 2012
Commits on Apr 29, 2012
  1. @pixeltrix
  2. @pixeltrix
Commits on Apr 18, 2012
  1. @oscardelben

    Fix formatting

    oscardelben committed Apr 18, 2012
Commits on Apr 17, 2012
  1. @vijaydev
  2. @oscardelben
  3. @avakhov

    Fix redirect with block example

    avakhov committed Apr 17, 2012
Commits on Dec 20, 2011
  1. @josevalim
Commits on Nov 18, 2011
  1. @tenderlove

    Revert "make sure to require the right deprecation warning file"

    tenderlove committed Nov 18, 2011
    This reverts commit 9d725e3df502a07222f35576108eb2df2bd88259.
  2. @tenderlove
  3. @tenderlove

    moving redirection to objects

    tenderlove committed Oct 31, 2011
  4. @tenderlove
  5. @tenderlove
  6. @tenderlove
  7. @tenderlove
Commits on Nov 30, 2010
  1. @joshk

    Added documentation explaining the new additional supported syntaxes …

    joshk committed Nov 30, 2010
    …for the routing redirect method, a small changelog note, and two extra tests for path interpolation when using the hash option syntax.
  2. @joshk

    The redirect routing method now allows for a hash of options which on…

    joshk committed Nov 30, 2010
    …ly changes the relevant parts of the url, or an object which responds to call can be supplied so common redirect rules can be easily reused. This commit includes a change where url generation from parts has been moved to AD::Http::URL as a class method.
Something went wrong with that request. Please try again.