0
在我看来,我想添加链接,我有:我怎样才能让一个的link_to远程链接拉起一个jQuery对话框中的Rails 3.1
= link_to 'My Account', edit_user_registration_path(:format => js), :remote => :true
#edit-dialog
我的控制器动作是空的。 我edit.js.erb样子:
$("#edit-dialog").dialog({
autoOpen: true,
width: auto,
open: function() {
$("edit-dialog").html(<%= escape_javascript(render('form')) %>")
}
});
当我点击链接,我得到的JavaScript渲染成一个新的网页文本。
$("edit-dialog").dialog({
autoOpen: true,
width: auto,
open: function() {
$("edit-dialog").html(<the partial contents are loaded here>)
}
});
为什么不是js得到执行。相反,它会以文本的形式返回并呈现为单独的页面。