trestle icon indicating copy to clipboard operation
trestle copied to clipboard

Override add link path on primary toolbar into collection

Open lphm opened this issue 3 years ago • 0 comments

I was unable to find how I could change the path behind the "+" (add) button in the primary toolbar.

I created several admin resources allowing to display different tables depending on the type of record.

But I would like the add action to load the form from another admin resource.

I test this but it does not work :

 controller do
    def index
      toolbar(:primary, { clear: true }) do |t|
        t.link 'add', admin.instance_path(:new, admin: 'erp/sales/pieces')
        # OR (but does not work...)
        t.new admin: 'erp/sales/pieces'
      end
    end
  end

lphm avatar Jan 08 '22 20:01 lphm