Customizing Columns By View
By default, Streamlined displays the same set of columns in all views. In some scenarios though, you may want to have a different set of columns displayed in the various views. For example, if you have a model with a large number of columns, then you'll likely want to limit the number of columns that appear in the list view (thus avoiding evil horizontal scrolling). Note that there are three view types--list (grid-array view), edit (single table entry), and show (single table entry). You can customize which fields each of these contains, or not specify anything to leave it as the default (all).
(Note: If you just want Streamlined to show all columns in all views, you needn't do anything. You get that functionality by default. If you want Streamlined to show a custom set of columns in all views, then you'll want to use the user_columns declaration.)
Customizing List View Columns
Use the list_columns declaration to explicitly specify which columns should be visible in the list view. In the example below, we've specified global options using the user_columns declaration, but we've overridden the global options in the list view.
Streamlined.ui_for(Person) do user_columns :first_name, :last_name, :nickname, :email_address, :created_at list_columns :first_name, :last_name, :email_address end
With this configuration, the columns listed in the user_columns declaration will appear in the show view, edit view, etc. The columns listed in the list_columns declaration will, not surprisingly, appear in the list view.
Any columns not listed in the list_columns declaration will be automatically excluded.
(When performing customizations of this nature, be sure to declare the user_columns before the list_columns.)
Customizing Edit View Columns
To explicitly specify which columns should be visible in the edit (single table entry edit) view, use the same approach demonstrated for list columns above, but use the edit_columns declaration.
Customizing Show View Columns
To explicitly specify which columns should be visible in the show (single table entry show) view, use the same approach demonstrated for list columns above, but use the show_columns declaration.
Customizing Quick Add Columns
To explicitly specify which columns should be visible in the quick add view, use the same approach demonstrated for list columns above, but use the quick_add_columns declaration.
