Skip to content

Redirection loop for controller#location with redirect_to #7916

@terlar

Description

@terlar

If I have a controller with the action location and inside that action I will do a redirect_to another url. Then I will get an infinite redirection loop.

routes.rb

resources :fruits

namespace :select do
  get :location
end

fruits_controller.rb

class FruitsController < ApplicationController
  def new
    # Do stuff
  end
end

select_controller.rb

class SelectController < ApplicationController
  def location
    if true
      return redirect_to new_fruit_url
    end
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions