trestle
trestle copied to clipboard
Override add link path on primary toolbar into collection
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