trestle
trestle copied to clipboard
Adding toolbars to a table via table block?
Hi @spohlenz is there any news regarding #65 ?
I would like to add a toolbar, for instance a secondary toolbar to a table block as you can do in a form.
Something like this:
table do toolbar(:secondary) do |t| t.dropdown "Other actions", class: "dropdown" do |d| d.link something end end column :somefield column :onemorefield actions do |toolbar, instance, admin| toolbar.edit if admin && admin.actions.include?(:edit) end end
Is this possible by expanding the table DSL? I would like to do this via DSL not by editing views.
I tried to create a separate table object (cloned from table) and managed to define a toolbar(:secondary) object in the object's block, but could not make the standard view to access the object.