Code Monkey home page Code Monkey logo

active_scaffold_sortable's Introduction

Drag-Drop Sortable for ActiveScaffold

Currently, this plugin is compatible with rails 3.x and master branches of vhochstein/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 vhochstein/ActiveScaffold to use this, and rails 3.x

script/plugin install clone git://github.com/vhochstein/active_scaffold_sortable.git

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
    config.sortable.column = :position
  end
end

Step 3

Create your 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>

Notice:

If you are using acts_as_list plugin you can skip the step 3

Support

If you have issues installing the plugin, search / post to the Active Scaffold forum or Create an issue

Contributing

Fork, hack, push, and request a pull:

http://github.com/vhochstein/active_scaffold_sortable/

License

Released under the MIT license (included).

Author

Contact me:


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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.