client/orders
및 notary/orders
이라는 컨트롤러가 두 개 있습니다. "client/orders"에 click_me 링크가 있습니다. 링크를 클릭하면 notary/orders/pending_orders
및 reload the notary/orders/pending_orders
페이지로 아약스 요청을 전달해야합니다. format.js가 레일에서 작동하지 않습니다. 2
이
는/클라이언트/주문 새로운 내 아약스 전화입니다<script>
jQuery.noConflict();
jQuery(document).ready(function(){
alert(9);
jQuery(".test_link").live("click", function(){
alert("am clicked");
jQuery.ajax({
url: "/notary/orders/pending_orders",
dataType: 'script',
type: "get",
data: {data:'hi'},
success:function(){
alert("success");
},
error:function(){
alert("failure");
}
});
})
});
<%= link_to "click me", "javascript:void(0);" , :class => "test_link" %>
이 내가이 작업을 수행 할 수 있습니다 pending_orders.How/
if request.xhr?
respond_to do |format|
format.js { render :js=>'location.reload();',
:location => "notary/orders/pending_orders"}
end
end
하지만 다시로드 client/orders/new
하지 notary/orders/pending_orders
는 나누었다 내가 공증/주문을 다시로드 할 notary/orders/pending_orders
내 코드?
대답이 나에게 더 많은 아이디어를주었습니다. 답장을 보내 주셔서 감사합니다. – Inaccessible