github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

activescaffold / active_scaffold_sortable

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 44
    • 10
  • Source
  • Commits
  • Network (10)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Fancy pants drag-drop sortable lists for ActiveScaffold — Read more

  cancel

http://tim.theenchanter.com/2008/05/activescaffoldsortable-updated-with.html

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

sortable 1 based as described here: 
http://groups.google.com/group/activescaffold/browse_thread/thread/2f06d97
337fa3373/5aa953bb86d493fe 
robd (author)
Mon Jun 23 10:56:24 -0700 2008
commit  3e2660ac79aff6075b2e723f82fe079c7913026b
tree    88013346a54048598592db29f2c9db45816b7368
parent  d659e07f579fceb4b14917a8e9c91adf0df84bb6
active_scaffold_sortable /
name age
history
message
file README.textile Thu Jun 19 10:05:06 -0700 2008 not compatible yet warning [timcharper]
file init.rb Fri May 16 16:13:21 -0700 2008 now compatible with restful routing (add :activ... [timcharper]
directory lib/ Mon Jun 23 10:56:24 -0700 2008 sortable 1 based as described here: http://grou... [robd]
directory public/ Mon Nov 05 07:51:19 -0800 2007 active_scaffold_sortable first import git-svn-... [timcharper]
directory views/ Mon Nov 05 07:51:19 -0800 2007 active_scaffold_sortable first import git-svn-... [timcharper]
README.textile

Drag-Drop Sortable for ActiveScaffold

Currently, this plugin is not compatible with rails 2.1, due to some outstanding compatibility issues with ActiveScaffold.

Overview

This plugin enables those slicker-than-snot ajax drag-drop sortable elements on your active-scaffold page, with so little configuration you almost get it for free.

Installation

You’ll need at least ActiveScaffold 1.1.1 to use this, and probably rails 2.0

# rails 2.0
git clone git://github.com/activescaffold/active_scaffold_sortable.git vendor/plugins/active_scaffold_sortable

Usage

Step 1

Create a model with a column named ‘position’:

# app/models/entry.rb

# id           integer
# title        string(255)
# birthday     date
# position     integer

class Entry < ActiveRecord::Base
end

Step 2

Create your scaffold controller

# app/controllers/entries_controller.rb

class EntryController < ApplicationController
  active_scaffold :entries do |config|
    config.actions << :sortable
  end
end

and layout

# app/views/layouts/application.rhtml
<html>
<head>
  <title>active scaffold demo application</title>
  <%= javascript_include_tag :defaults %>
  <%= active_scaffold_includes %>
</head>
<body>
  <%= yield %>
</body>
</html>

Step 3

If you’re using restful routes, append this to your route in routes.rb:

  map.resources :tasks, :active_scaffold => true, :active_scaffold_sortable => true

Notice:

If you’d like to use a different column name, put this line in your controller:

...
active_scaffold :entries do |config|
  config.sortable.column = :position
end
...

Support

If you have issues installing the plugin, search / post to the "Active Scaffold ":http://groups.google.com/group/activescaffold forum or Create an issue

Contributing

Fork, hack, push, and request a pull:

http://github.com/activescaffold/active_scaffold_sortable/

Author

Contact me:


Tim Harper – irb(main):001:0> ( ‘tim_see_harperATgmail._see_om’.gsub(‘see’, ‘c’).gsub(‘AT’, ‘@’) )

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server