-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathREADME
75 lines (46 loc) · 2.2 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
This works with Rails 2.3 and the rails-2.3 branch of ActiveScaffold.
Clone or view the source at: http://github.com/bonefish/active_scaffold_config_list
Usage:
Enabled by default. To disable add the following to your controller:
active_scaffold :model do |config|
config.config_list.enabled = false
end
Enhancements:
Two new options have been added: "Reset to Default" and "Show All Columns"
You have the option of defining a default set of columns for the controller.
e.g
config.config_list.default_columns = [:name, :project, :amount]
If this is not defined then active_scaffold_config.list.columns is used.
This is useful when you want the option to look at a potentially large number of columns but be able to
easily reset back to something that fits on the screen without horizontal scrolling.
Original version: http://code.google.com/p/activescaffoldconfiglist/
Overview
A plugin for Active Scaffold that provides the ability to choose the column to show in the scaffold list at run-time
Features
The configuration data will be saved on the session.
Installation
To install the plugin:
For active_scaffold 1.1.1
./script/plugin install http://activescaffoldconfiglist.googlecode.com/svn/trunk/active_scaffold_config_list
For active_scaffold 1.0
./script/plugin install http://activescaffoldconfiglist.googlecode.com/svn/tags/for_as_1.0/active_scaffold_config_list
Use
This plugin automatically adds an action labeled 'List columns...' to every scaffold. Now you can show/hide the columns in the list.
To define which are the default visible columns add this line to the active scaffold config section of your controller:
config.config_list.default_columns = [:name, :description, ...]
To exclude config list for a controller:
config.config_list.enabled = false
Suggestion
Useful if used with acts_as_proxy plugin
http://code.google.com/p/actsasproxy/
Example: Model:
class User < ActiveRecord::Base
has_one :address
proxies :address, :city, :state, :zip
end
Scaffold:
config.list.columns = [:first_name, :last_name, :address_city, :adress_state, :address_zip, ...]
...
config.config_list.default_columns = [:first_name, last_name]
}}
So you can have by default a minimal list and add columns at run-time