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]
About these ads