Ruby on rails 如何实现方法中调用的函数";onUpdate“;在Rails中使用sortable.create时

Ruby on rails 如何实现方法中调用的函数";onUpdate“;在Rails中使用sortable.create时,ruby-on-rails,ajax,jquery-ui-sortable,scriptaculous,Ruby On Rails,Ajax,Jquery Ui Sortable,Scriptaculous,我正在使用ROR创建一个应用程序,我想知道如何实现我想在使用“sortable.create”时调用的函数 下面是我的“*.html.erb”文件中的示例代码 创建(“表_保留”{ 标记:“tr”,dropOnEmpty:true,onUpdate:function(){alert('Updated!');}, 包含:[“表感知”、“表考虑”、“表获取”],重影:true }) 我想调用一个实际的函数,而不是“Alert”,在这种情况下,我可以将参数传递给该函数,列表为“table_reta

我正在使用ROR创建一个应用程序,我想知道如何实现我想在使用“sortable.create”时调用的函数

下面是我的“*.html.erb”文件中的示例代码


创建(“表_保留”{
标记:“tr”,dropOnEmpty:true,onUpdate:function(){alert('Updated!');},
包含:[“表感知”、“表考虑”、“表获取”],重影:true
})
我想调用一个实际的函数,而不是“Alert”,在这种情况下,我可以将参数传递给该函数,列表为“table_retain”,并在“Application Controller”中实现该函数

我想知道如何做到这一点的语法。我是ROR新手,任何帮助都将不胜感激


谢谢

我不确定我是否遗漏了什么,但您是否尝试过:

<script type="text/javascript">
   Sortable.create("table_retain", {
      tag:"tr" , dropOnEmpty: true, onUpdate: function() { yourFunction("table_retain"); },
      containment:["table_aware","table_consider","table_acquire"], ghosting:true
   })
</script>

创建(“表_保留”{
标记:“tr”,dropOnEmpty:true,onUpdate:function(){yourFunction(“table_retain”);},
包含:[“表感知”、“表考虑”、“表获取”],重影:true
})
<script type="text/javascript">
   Sortable.create("table_retain", {
      tag:"tr" , dropOnEmpty: true, onUpdate: function() { yourFunction("table_retain"); },
      containment:["table_aware","table_consider","table_acquire"], ghosting:true
   })
</script>