Got it. The example I was working from didn't need to fire at a server. One has to properly tag the <li>'s to get the Serialize capability, which is apparently required to fire the Ajax request.

It's a bit maddening that this produces no errors, or anything. Maybe Scriptaculous should throw an error if a URL is set, but the serialize fails?


-- Joshua

On 5/24/06, Josh on Rails <[EMAIL PROTECTED]> wrote:
Using Rails to generate a sortable list, I get the draggable/sortable page elements, but Ajax never fires back the post-sorted list. (I've checked with IE & Firefox, the "save this order to the DB" controller hasn't been called.)

The View:

    <p>Drag to sort.<span id="sort_info"></span></p>
    
    <ul id="sort1">
    <% @estimate.components.each do |comp| -%>
      <li class="draggable"><%= comp.name -%></li>
    <% end %>
    </ul>
    <%= sortable_element('sort1', {
               :url="" :id=>@ estimate.id},
               :update=>'sort_info'} ) -%>

The Generated Source:
<p>Drag to sort.<span
 id="sort_info"></span></p>

<ul id="sort1">
<li class="draggable">Something Due Soon</
li>
<li class ="draggable">Some Due Sooner</ li>
<li class="draggable">Some Due Later</li>
<li class="draggable">The Earliest of All</li>
	
</ul>
<script type= "text/_javascript_">
//<![CDATA[
Sortable.create("sort1", {onUpdate:function(){new Ajax.Updater('sort_info', '/estimate/order/15', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("sort1")})}})
//]]>
</ script>

Any ideas what's going on?


_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to