![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
= Is Positionable
== What is "Is Positionable"?
Is Positionable handles the positioning (ordering) your ActiveRecord Objects. It makes use of the "Acts As List" gem to do it the most efficient way. Is Positionable basically creates a front-end (dynamically generates buttons and actions) for moving ActiveRecord Objects "up", "down", to the "top" and to the "bottom". Doing the simplest set up takes just 1 word: "is_positionable".
=== Quick and Simple Example
==== config/environment.rb
config.gem "is_positionable", :source => "http://gemcutter.org/"
==== app/controllers/posts_controller.rb
PostsController < ApplicationController is_positionable
def index
@posts = Post.all
end
...
end
==== app/models/post.rb
class Post < ActiveRecord::Base default_scope :order => :position end
==== app/views/posts/index.html.erb
for post in @posts <%= up_button_for_posts(@posts, post) %> <%= down_button_for_posts(@posts, post) %> <%= top_button_for_posts(@posts, post) %> <%= bottom_button_for_posts(@posts, post) %> ... # Other Stuff like post.name post.user.name etc. end
With just this bit of code, you now enabled positioning with "posts". This might already be obvious, but the following 4 buttons are generated per post:
Now, this is the most basic setup. You might have "users" manage posts. So that'd mean "User has_many :posts". In this case you can add a "scope" and "scope_object" so that one user cannot conflict with another user's post positions.
This would look something like this
is_listable :scope => :user_id, :scope_object => current_user
The above will ensure that, not only will one users' post NOT conflict with another users' post, but if one user tries to be hack-ish and try to attempt to change post position of a different user through cURL or the AddressBar it will be out of scope cause of the :scope_object attribute, restricting access to any other user, but the owner of the post.
==== Of course, these are not the only options you can set, for more information, see the Wiki pages!
==== Setting all this up takes me about 1-2 minutes
== Interested in trying out "Is Positionable"?
=== Check out the following Wiki pages:
=== Installation
http://wiki.github.com/meskyanichi/is_positionable/installation
=== Getting Started
http://wiki.github.com/meskyanichi/is_positionable/getting-started
=== Options
http://wiki.github.com/meskyanichi/is_positionable/options
== Copyright
Copyright (c) 2009 meskyanichi. See LICENSE for details.
FAQs
Unknown package
We found that is_positionable 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.