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
acts_as_list
end
view: index.rb
Listing listings
- <%=h listing.name %> <%=h listing.completed_dt %> <%=h listing.position %> <% end %>
<% for listing in @listings %>
<% sortable_element ‘item_list’, :url => { :action => “sort” }
%>
<%= 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
item.save
end
@list = Listing.find(:all, :order => ‘position’)
render :layout => false, :action => :index
end
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?
Thanks
Phil