3
일부 코드가 있는데 : notice가 있습니다.이 코드는 선택적으로 표시됩니다. 로부터 인덱스 :로 리디렉션 할 때Rails 3 알림이 Redirect_To를 사용할 때 작동하지 않습니다
여기 코드
respond_to do |format|
if @userhj.save
format.html { redirect_to(:action => :index, :notice => 'Succesfully assigned job') }
format.xml { render :xml => @userhj, :status => :created, :location => @userhj }
else
format.html { redirect_to(:root, :notice => 'Duplicate job assignment') }
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
end
end
의 인덱스 뷰,주의 사항이 제대로 표시되지 않습니다. Firebug의 net 콘솔을 살펴보면, GET (여기에 URL 삽입)? notice = (notice text)가 있는데,주의 사항이 올바르게 나타나면 다른 페이지에는 나타나지 않습니다.
저는이 자습서 http://www.logansbailey.com/2010/10/06/how-to-setup-authlogic-in-rails-3/을 사용하여 설정 한 authlogic을 사용하고 있습니다. 어떤 도움을 주셔서 감사합니다. 감사.
오, 그 완벽하게 작동합니다! 나 한테 얼마나 미치고 있는지 말해 줄 수 없어! 감사! – CCSab
감사합니다. 나는 여분 param와 통고를 함께 통과해야했다. 나는 당신의 대답을 찾을 때까지 그 일을 할 수 없었습니다. redirect_to ({: controller => 'sales', : action => 'new', : linked_id => @ purchase.id}, {: notice => '통지.'}) – Bot