Skip to content

How To: Link To Trestle

Nathan Colgate edited this page Aug 1, 2018 · 8 revisions

You can link to Trestle from other areas of your application. Use rake routes to see what's available under the Trestle::Engine:

Routes for Trestle::Engine:
warheads_admin_index GET    /warheads(.:format)          warheads_admin/admin#index
                     POST   /warheads(.:format)          warheads_admin/admin#create
  new_warheads_admin GET    /warheads/new(.:format)      warheads_admin/admin#new
 edit_warheads_admin GET    /warheads/:id/edit(.:format) warheads_admin/admin#edit
      warheads_admin GET    /warheads/:id(.:format)      warheads_admin/admin#show
                     PATCH  /warheads/:id(.:format)      warheads_admin/admin#update
                     PUT    /warheads/:id(.:format)      warheads_admin/admin#update
                     DELETE /warheads/:id(.:format)      warheads_admin/admin#destroy

Then from within your application add the trestle prefix to your routes:

%p= link_to 'Build a New Warhead for Fun and Profit!', trestle.new_warheads_admin_path

If you want to link to your application from Trestle, use the main_app prefix:

%p= link_to 'Back to the Command Center', main_app.root_path