我无法禁用JQuery mobile对link_to
的Ajax调用。
我有一个带重定向的链接。
<%= link_to 'test', my_post_path, :method => :post, "data-role" => "button", "rel" => "external", "data-ajax"=>"false", "data-inline" => "true", "data-icon" => "plus", "data-iconpos" => "left" %>
以下是使用HTML翻译的内容:
<a href="/my_post" data-ajax="false" data-icon="plus" data-iconpos="left" data-inline="true" data-method="post" data-role="button" rel="external nofollow">test</a>
my_post仅仅是一个重定向到
def my_post
redirect_to another_method_path(....)
end
我以为设置
data-ajax=false
就足以禁用此链接的Ajax功能,但事实并非如此。首先调用another_method_path
,然后我得到了my_post_path
。如果我完全禁用Ajax
$.mobile.ajaxEnabled = false;
它按预期工作。
在本地化的 link_to
中,我做错了什么吗?