Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1017743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:45:04+00:00 2026-05-16T10:45:04+00:00

I have followed the instructions on http://railscasts.com/episodes/147-sortable-lists for creating a sortable list. The list

  • 0

I have followed the instructions on http://railscasts.com/episodes/147-sortable-lists for creating a sortable list.

The list drags and drops as it is supposed to, but the sort action is not being fired when the link is released. I have tested this by putting a render :text command into the sort.

No error’s appear, it just doesn’t fire off the action. I have tried other actions to test it and it doesn’t go to them either.

Index:

<ul id="tasks">
  <% @tasks.each do |task| %>
      <%content_tag_for :li, task do %>
      <span class ="handle"> [drag] </span>
      <%= link_to task.name, task %>
    <% end %>
  <% end  %>
</ul>
<%= sortable_element("tasks", :url => sort_tasks_path) %>

Controller:

 def sort
    #render :text => 'sorted'
    params[:tasks].each_with_index do |id, index|
      Task.update_all(['position=?', index+1], ['id=?', id])
    end
    #render :text => 'sorted'
    render :nothing => true
  end

route:

  map.resources :tasks, :collection => {:sort => :post}

  map.resources :tasks
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:45:04+00:00Added an answer on May 16, 2026 at 10:45 am

    forgot to sort the order of the tasks for display:

    @tasks = Task.all(:order => "position")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I followed the instructions in Railscasts #197 http://railscasts.com/episodes/197-nested-model-form-part-2 about how to add links that
I have followed all the instructions here: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/ to install & config apache get
I have followed the instructions found at http://code.google.com/p/pubsubhubbub/wiki/DeveloperGettingStartedGuide to setup a hub. When I
I have problem with uploading files. I followed these instructions: http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html and everything is
I have followed the instructions at http://www.javacodegeeks.com/2011/01/advanced-smartgwt-tutorial-part-1.html and tried to create a simple screen
So I've followed the instructions here: http://doganberktas.com/2010/09/14/amazon-s3-and-paperclip-rails-3/ In my profile model I have: attr_accessor
I followed these instructions here: http://logback.qos.ch/consolePlugin.html I have the correct and found logback.xml, it
I followed instructions on http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ and succesfully inserted sqlite database on android device so
I'm on shared server environment (Dreamhost.com uses Linux/Debian). I followed their instructions @ http://wiki.dreamhost.com/Advanced_PHP_configuration
Admob code can't see on device. I followed the instructions here: http://www.admob.com/docs/AdMob_Android_SDK_Instructions.pdf everything ok,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.