Forum: Ruby on Rails acts_as_list issue

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
tankow (Guest)
on 2008-10-30 05:24
(Received via mailing list)
The list i have defined in my acts_as_list will not let me drag the li
elements around.  I am using FF, but IE6 also fails.  Here is what i
have defined in my code:

model: listing.rb

class Listing < ActiveRecord::Base

view: index.rb

<h1>Listing listings</h1>

<div id="items">
<ul id="item_list">

<% for listing in @listings %>
  <li id="item_<%= %>">
    <%=h %>
    <%=h listing.completed_dt %>
    <%=h listing.position %>
<% end %>

<% sortable_element 'item_list', :url => { :action => "sort" }

<br />

<%= link_to 'New listing', new_listing_path %>

controller: listings_controller.rb

  def sort
  params[:item_list].each_index do |i|
    item = Listing.find(params[:item_list][i])
      item.position = i
    @list = Listing.find(:all, :order => 'position')
    render :layout => false, :action => :index

I also have all of the javascript includes in the layout and can see
them when i view source of the page.

What am i missing? or what is wrong with the code?

tankow (Guest)
on 2008-11-02 04:33
(Received via mailing list)
problem was the invalidauthenticitytoken
This topic is locked and can not be replied to.