Sha256: 4d9e5f9f068d7402e0c669ff4370406042f78dc09add096a1f9bc14a6642bca4
Contents?: true
Size: 1.04 KB
Versions: 8
Compression:
Stored size: 1.04 KB
Contents
This works with Rails 3.2 and ActiveScaffold >= 3.3 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 attribute storing the config list.
Version data entries
8 entries across 8 versions & 1 rubygems