mardi 4 août 2015

new_path url is showing correctly in address bar but displaying a different page

I'm having a problem where my link to orders#new is bringing up the right url in the browser but is rendering what looks like orders#index but with no entries in it.

Here are my routes, I'm wondering if I've got a problem with the priorities in them?

  get 'loans/stock' => 'loans#stock'
  resources :loans
  get 'parts/all' => 'parts#view', :as => :parts_all
  get 'orders/:region' => 'orders#region', :as => :orders_by_region
  get 'orders/:printer/parts' => 'orders#printerparts', :as => :parts_by_printer
  resources :orders do
    resources :parts
  end
  resources :parts

EDIT I've taken the below advice and resorted my routes but it seems whatever I do something breaks. I have a link for my orders filtering by region and the filter to show parts belonging to an order by it's printer.

If I move the region route down it stops working. If I leave it where it is, the new and show actions won't work for orders. Maybe I've just done something completely wrong in my setup?

Aucun commentaire:

Enregistrer un commentaire