Sha256: aaa90aeeb25400f9c59485d0c073e9ebc2249054d4c8ed9361133d2c58e35b1b

Contents?: true

Size: 1.22 KB

Versions: 6

Compression:

Stored size: 1.22 KB

Contents

This works with Rails >= 4.0 and ActiveScaffold >= 3.4.4
Version 3.3.x worked with Rails 3.2 and ActiveScaffold >= 3.4.4
Version 3.2.x worked with Rails 3.2 and ActiveScaffold >= 3.3.0

Usage:
active_scaffold :model do |conf|
  conf.actions.add :config_list
end


Overview

A plugin for Active Scaffold that provides the ability to choose the column to show in the scaffold list at run-time

The configuration data will be saved on the session. It can be saved on the DB defining a method to return a record
for current controller, or empty record if user has no list configuration, and setting config_list to use that method.

conf.config_list.save_to_user = :config_list_for

class User < ActiveRecord::Base
  has_many :list_configurations
  def config_list_for(controller_id, controller_name)
    list_configurations.where(:controller_id => controller_id).first_or_initialize # different columns on different nested or embedded conditions
    list_configurations.where(:controller_id => controller_name).first_or_initialize # one configuration for the controller, even embedded or nested
  end
end

The model storing list configuration must have a config_list text column storing the config list, and config_list_sort serialized text column.

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
active_scaffold_config_list-3.5.0 README
active_scaffold_config_list-3.4.4 README
active_scaffold_config_list-3.4.3 README
active_scaffold_config_list-3.4.2 README
active_scaffold_config_list-3.4.1 README
active_scaffold_config_list-3.4.0 README