
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
jsort does the javascript/jquery stuff for drag&drop sortable lists in your rails applications.
Model
Your model should have a 'position'-column of type integer.
Controller
def sort
params[:ordered_items].each_with_index do |id,idx|
m = MyModel.find(id)
m.position = idx
m.save
end
render :nothing => true
end
View (HAML; obviously, will work with html.erb too)
- jsort(@my_items,'ordered_items', sort_my_controller_path) do |item|
= item.name
= link_to "[Edit]", edit_my_item_path(item)
Parameters
jsort ITEMS, NAME, PATH, [OPTIONS]
params[:NAME]
passed to the controller.:text => 'MOVE
- Will use this text as a drag-n-drop-handle instead of the image:image => 'yourimage.jpg'
- use your own image (place it in assets/images path of your application:handle_only => true
- Only the handle (image or text) can be used to drag&move. Default is 'false' which allows you to pick up by clicking anywhere on the line.:register => false
- no call to registerSortableList($('#list-id')
will be implemented and you have to call the register-function in your own code (eg. coffee-script). Use this strategie if you're using Twitter-Bootstrap and loading the application.js at the end of your layout-file:sortable_id => :id
- default's to :id.This will display an ordered list which is sortable by drag and drop.
The block passed to jsort will be used to format each line/item. If no block is
given item.to_s
will be used to display the items.
gem "jsort", "~> 0.0.1"
to your Gemfile//= require jsort_sortable
Copyright (c) 2011 Andi Altendorfer. See LICENSE.txt for further details.
FAQs
Unknown package
We found that jsort demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.