Module: ActionTable::Helper

Defined in:
lib/action_table/helper.rb

Instance Method Summary collapse

Instance Method Details

#action_table(records, fields, styles: %i[bordered striped hover],, link: :name, paginate: false, actions: []) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/action_table/helper.rb', line 8

def action_table(
  records,
  fields,
  styles: i[bordered striped hover],
  link: :name,
  paginate: false,
  actions: []
)
  action_table = View.new(
    cols: fields,
    records: records,
    paginate: paginate,
    link: link,
    actions: actions,
    styles: styles,
  )

  render('action_table/table', table: action_table)
end