Method: Datagrid::Helper#datagrid_form_for

Defined in:
lib/datagrid/helper.rb

#datagrid_form_for(grid, options = {}) ⇒ String

Deprecated.

Use #datagrid_form_with instead.

Renders HTML for grid with all filters inputs and labels defined in it

Supported options:

  • :partials - Path for form partial lookup. Default: 'datagrid'.
  • All options supported by Rails form_with helper

Parameters:

  • grid (Datagrid::Base)

    grid object

  • options (Hash) (defaults to: {})

Returns:

  • (String)

    form HTML tag markup

[View source]

389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/datagrid/helper.rb', line 389

def datagrid_form_for(grid, options = {})
  Datagrid::Utils.warn_once("datagrid_form_for is deprecated if favor of datagrid_form_with.")
  _render_partial(
    "form", options[:partials],
    grid: grid,
    options: {
      method: :get,
      as: grid.param_name,
      local: true,
      **options,
    },
  )
end