레일이 왜 깜박입니까 [: notice] = "msg"work where : notice => "msg"? 통지 표시 나는 다음과 같은 코드를 사용하는 경우 :Rails가 [: notice] = "msg"작업을하는 이유는 무엇입니까? : notice => "msg"?
# Case 1 (this works)
flash[:notice] = 'Candidate was successfully registered.'
format.html { redirect_to :action => "show_matches", :id => @trial.id }
이 작동하지 않습니다 :
# Case 2 (this doesn't)
format.html { redirect_to :action => "show_matches", :id => @trial.id, :notice => "Candidate was successfully registered."}
하지만 내 응용 프로그램의 다른 영역에서
은, 위의 기술은 잘 작동합니다 :# Case 3 (this works)
format.html { redirect_to @candidate, :notice => 'Candidate was successfully created.' }
내 레이아웃 포함 내역 :
그럼 내 질문은 왜 :notice => ""
을 하나의 케이스에서 사용할 수 있습니까?
많은 컨텍스트를 제공하지는 못했지만 내 감각은 실제로 매우 간단하다는 것입니다.
p.s. 이것은 this question과 유사합니다.
는
나는 이해합니다! 고맙습니다. 귀하의 설명이 의미가 있으며 귀하의 제안 된 코드가 제 신청서에서 작동합니다. (간단한 설명 : 괄호는 균형이 맞지 않습니다.) – DavidS