Mr Bonefish created a plugin called active_scaffold_config_list which empowers the user to hide and show columns in list view. That s a really valuable feature and should still exist in the world of rails 3, I thought.
You may find the result of my thoughts in a fork of active_scaffold_config_list.
You are still able to hide and show columns. In addition I ve empowered the user to change the order of list columns by simple drag and drop. Please note that you cannot drag and drop the columns itself, but instead you can drag and drop the column names in the config_list action form.
Let me guide you through the steps to install and configure config_list plugin.
We will start with installation of active_scaffold_config_list plugin.
rails plugin install git://github.com/vhochstein/active_scaffold_config_list.git
Afterwards, we have to add config_list action to our controller.
active_scaffold :player do |conf| conf.actions << :config_list end
Yes and thats it. You should see a new collection action_link, which empowers your users to configure list view as they like.
Bonefish implemented another neat feature, which survived transformation to rails 3. You may define a set of default_columns for your list_view.
That s really useful if you ve got tons of list columns available, but as a default you would only like to show a subset of them.
conf.config_list.default_columns = [:name, :salary, :team]
Feb 07, 2011 @ 17:16:19
Note to users, that this, among with any per request configuration on active_scaffold_config, is not thread safe and can only be deployed in shared-nothing architecture, as it modifies class properties that are pseudoglobal (active_scaffold_config.list.columns).
Feb 09, 2011 @ 06:31:54
Hi, you are generally right, however in this special case active_scaffold_config.list.columns itself is nt changed. Hope I remember this correclty.
Apr 06, 2011 @ 09:59:17
And who was right in the end?
Regards
Michael
Apr 06, 2011 @ 10:07:51
Well, I would say it s thread-safe as long as you do not change active_scaffold_config directly.