Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Acts as list helper for active admin
Ruby JavaScript
branch: master

This branch is 4 commits behind robotex82:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
config/locales
lib
test
.gitignore
Gemfile
Gemfile.lock
MIT-LICENSE
README.rdoc
Rakefile
active_admin-acts_as_list-0.0.1.gem
active_admin-acts_as_list-0.0.2.gem
active_admin-acts_as_list-0.0.3.gem
active_admin-acts_as_list-0.0.4.gem
active_admin-acts_as_list.gemspec

README.rdoc

ActiveAdminActsAsList

Purpose

Add sortable columns for active admin.

Features

  • Add member actions with one method call

  • Add sorting columns in your index views with one method call.

  • Integrates with acts_as_list

Prerequisites

You need active_admin and acts_as_list.

Installation

Add it to your gemfile:

gem 'active_admin-acts_as_list'

Install your bundle:

> bundle install

Usage

Assuming you have a Players model:

class Player < ActiveRecord::Base
  # acts as list
  acts_as_list
  default_scope :order => 'position ASC'

  #...
end

You can add sortable columns, member actions and sorting like this:

#app/admin/players.rb
ActiveAdmin.register Player do
  # Sort players by position
  config.sort_order = 'position'

  # Add member actions for positioning.
  sortable_member_actions

  index do
    # This adds columns for moving up, down, top and bottom.
    sortable_columns

    #...
    column :firstname
    column :lastname
    default_actions
  end
end

Todo

  • Tests, tests, tests.

  • Better docs.

License

This project rocks and uses MIT-LICENSE.

Something went wrong with that request. Please try again.