当用户单击添加时,我想关闭以下对话框:
<head>
<script>
$(function() {
$( "#dialog" ).dialog();
});
</script>
</head>
<body> <div id="dialog" title="Select Item">
<%= form_tag( {:controller => :foos, :action => :update_position, :position => @i , :id => @foo.id }, :remote => true) do %>
<td>
<%= select_tag :position_name, options_for_select(@selection_list) %>
</td>
<td>
<%= hidden_field_tag 'position', @i %>
<%= submit_tag "Add" , :class => "btn" %>
<script>
function() {
$( this ).dialog( "close" );
}
</script>
</td>
<% end %>
</div>
</body>
我不知道如何安排 RoR 的陈述。感谢您的任何提示。