Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

acts_as_restful_list

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acts_as_restful_list

  • 0.6
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= acts_as_restful_list

It's just like acts_as_list, but instead of having to clutter your code with non-standard method calls like insert_at, acts_as_restful_list makes managing lists simple. You update the position attribute just like you would update anything else and the rest is taken care of for you.

== Features

  • Automatically update your list's order through standard REST methods
  • Support for Rails Optimistic Locking

== Installation #environment.rb config.gem 'acts_as_restful_list'

in Terminal

rake gems:install

== Usage

=== In your model:

class Item < ActiveRecord::Base belongs_to :parent acts_as_restful_list :scope => :parent end

=== Now, simply CRUD away:

item = Item.create item.position # 1

item2 = Item.create item.position # 2

item3 = Item.create item.position # 3

item.destroy item2.position # 1 item3.position # 2

item3.position = 1 item3.save item3.position # 1 item2.position # 2

different_parent = Item.create(:parent_id => 1) different_parent.position # 1

And that's that.

Report issues at http://github.com/12spokes/acts_as_restful_list/issues

== Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add specs for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2010 '12 Spokes'. See LICENSE for details.

FAQs

Package last updated on 18 Jul 2011

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc