rails(4.1.0)에서 action 이름이location인 경우redirectto 에서 stack level too deep 오류가 발생했습니다.

1803 단어 RubyRails
위치 뿐만 아니라 메시지에 오류가 발생하려고 하는 사람도 있다.
Rails에서 SystemStackError를 만났습니다: stack level too deep... - (define-ayalog'()
컨트롤러의 후계자인 Application Controller의 어딘가가 정의되었지만 찾지 못했기 때문이라고 생각합니다.
Stack level too deep 오류가 발생하면 액션 이름을 바꾸면 우선 리디렉션이 순조롭게 진행되지만 액션 이름에 지정할 수 없는 이름 일람표를 원합니다.
다음 출처
routes.rb
  root 'hoge#index'
  get 'location' => 'hoge#location'
  get 'message' => 'hoge#message'
hoge_controller.rb
class HogeController < ApplicationController
  def index
    render :text => "index"
  end

  def location
    redirect_to :root
  end

  def message
    redirect_to :root
  end
end

액세스/location 시 화면

좋은 웹페이지 즐겨찾기