Export Configuration - activescaffold/active_scaffold_export GitHub Wiki

allow_full_download global local

When it's enabled, it allows to the user to choose downloading the whole data or just the current page, if it's disabled it will force to use the default setting, controlled by default_full_download setting. It's enabled by default.

columns

The set of columns used for the export action. These columns will be exported, but user can unselect some of them if show_form is enabled.

config.export.columns = [:vendor, :project, :percent, :balance, :total]

default_delimiter global local

The column delimiter for the CSV used by default, it defaults to ,. When show_form is enabled, the user can change the default setting in the form.

default_deselected_columns

When show_form is enabled, the user can select what columns want to include in the export, all columns defined in export action are selected by default, except the columns listed in this setting.

config.export.columns = [:vendor, :project, :percent, :balance, :total]
config.export.default_deselected_columns = [:percent] # these columns are not selected by default

The setting has no usage if show_form is disabled, as export action will export all columns in export.columns.

default_file_format global local

Default format used to export, it defaults to xlsx when the gem caxlsx is available, otherwise csv will be the default. When show_form is enabled, the user can change the default setting in the form.

default_full_download global local

When it's enabled, it defaults to export the whole table, otherwise it will just export the current page. It's enabled by default. When allow_full_download and show_form are enabled, the user can change the default setting in the form.

default_skip_header global local

When it's enabled, it won't export a header, otherwise the columns' labels will be exported in the first column, as a header. It's disabled by default, so header is exported. When show_form is enabled, the user can change the default setting in the form.

floating_footer global local

A flag to enable floating footer, so buttons of form footer are floating when the form is too big to fit in the window, and they are always accessible without scrolling down.

force_quotes global local

The force_quotes option for CSV ruby library. It's disabled by default.

formats

It defaults to :csv and :xlsx. If you need to add another mime type for the export action you can do it here.

label local

The heading used for the Export form. Normally this heading is based on the core's label.

link global local

The action link used to tie the Export action to the List table. Most likely, you'll use this to change the label for your link.

config.export.link.label = "Export Data"

See API: Action Link for additional parameters for this link.

The global config is for the link to open the export form, which is the default. If show_form is disabled, then the local config will return the link to export action instead of show_export action, which exports data with the settings defined in the controller, without allowing the user to choose columns or format options.

show_form global local

When it's enabled, a form is open so user can select what columns include in the export file, what format to export, and some settings for csv format. If disabled, export action will export the data using the default settings defined in the controller.

It defaults to open a form.

⚠️ **GitHub.com Fallback** ⚠️