Drag and drop ordering in rails
Add order_number column into news table:- rails g migration add_order_number_to_news order_number:integer In config/routes.rb get '/news_ordering/(:id)' => 'news#news_ordering', as: :news_ordering post '/re_order_news' => 'news#re_order_news' In app/views/news/news_ordering.html.erb <style> #sortable { list-style-type: none; margin: 0; width: 60%; cursor: pointer; } .pic_box { border: 1px #cccccc solid; padding: 2%; margin: 1%; width: 50%; } .img_box{ height: 60px; width: 60px; } </style> <div class="wrapper wrapper-content animated fadeInRight"> ...