On 3/3/06, Sean Mountcastle <[EMAIL PROTECTED]> wrote:
> I'm having some difficulty adding drag-and-drop sorting to my
> application. I'm hoping that someone can help me figure out what I'm
> doing wrong:
>
> #view
> <table>
> ...
> <tbody id="item-list-body">
> <tr id="view-item-<%= item.id %>"....</tr>
> </tbody>
> ...
> <%= sortable_element('item-list-body',
> :tagname => 'tr',
> :url => { :controller => 'Item', :action => 'reorder' })
> %>
>
> I see that the JavaScript debugger is complaining that "tr is not
> defined" because the above code gets translated to:
>
> <script type="text/javascript">
> //<![CDATA[
> Sortable.create('item-list-body', {onUpdate:function(){new
> Ajax.Request('/Item/reorder', {asynchronous:true, evalScripts:true,
> parameters:Sortable.serialize('item-list-body')})}, tagname:tr})
> //]]>
> </script>
>
> How can I get the tagname:tr to be tagname:'tr' (I assume this is the
> problem).
>
Could you try to replace :tagname by :tag ?
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs