내가 자동으로 게시물을 다시로드하고 사업부의 post_container에 삽입 할 몇 가지 코드 원 :이 레일 내 home.html.erb에 니펫을레일 AJAX로드 '갱신'에 전체 페이지를 DIV
<%= link_to_remote "Update", {:action => 'ajax_update', :id => @posts, :update => 'post_container'}, :confirm => "Are you sure?" %>
실제로 소요를 전체 페이지 (title, head, body 태그)를 div post_container 내에 배치합니다. 왜? 또한, 내가 말할 수있는 한, ajax_update 함수는 호출되지 않는다.
나는 어떻게하려고합니까? 왜이 전체 페이지로드가 발생합니까? 나는 레일 2.3.11을 사용하고
(편집 :. 또한,이 링크를 클릭 더 확인 대화 상자 없음)
<a confirm="Are you sure?" href="#" onclick="new Ajax.Updater('post_container', '/home', {asynchronous:true, evalScripts:true, parameters:'authenticity_token=' + encodeURIComponent('uaqM0Ie8to5pprvE6WcF416DN0vNeyO7Xa+JM6VZFY4=')}); return false;">Update</a>
: 코드 조각의 HTML 출력
EDIT (2) 컨트롤러 액션에서
': remote => true'를 추가 하시겠습니까? – uday