Module: CrudComponents::Helpers
- Defined in:
- lib/crud_components/helpers.rb
Overview
The everyday view API, included into ActionView by the engine. Every helper
builds a presenter and renders a partial you can override via the host app's
view path (app/views/crud_components/…).
Instance Method Summary collapse
-
#crud_actions(subject, fieldset: nil) ⇒ ActiveSupport::SafeBuffer
The action buttons for a record (row actions) or a model class (collection actions) — for manual placement when you render with
actions: false. -
#crud_association_index_path(owner, field) ⇒ String?
The index a has_many cell links to: nested under the owner, else the target's filtered index, else nil.
-
#crud_association_label(field, record) ⇒ String
The label for an associated record in an association column: a per-column
label:callable (attribute :order, label: ->(o) { o.full_title(short: true) }) when given, else the target's default #crud_label. -
#crud_collection(records, fieldset: nil, layout: :table, query: :auto, param_prefix: nil, actions: true, search_bar: true, group_by: nil, extra_columns: nil, picker: false, picked_columns: :auto) ⇒ ActiveSupport::SafeBuffer
A set of records as a table (or any layout partial you point
layout:at). -
#crud_column_picker(subject, fieldset: nil, extra_columns: nil, picked_columns: :auto, url: nil, param_prefix: nil) ⇒ ActiveSupport::SafeBuffer
A standalone column picker — the same gear-and-checklist the table renders in its header, but placed wherever you like (e.g. above a
crud_recorddetail view). -
#crud_components_styles ⇒ Object
Inline the gem's stylesheet (the column-picker float styles) as a