0

我有这两条路线

get     '/opportunities/:id(/:tab_name)'  => 'opportunities#show',     as: 'opportunity'
get     '/opportunities/:id/edit'         => 'opportunities#edit',     as: 'edit_opportunity'

但当然,该edit路线不起作用,因为它是作为:tab_name. 我怎样才能edit破例?

谢谢。

4

1 回答 1

0

Putting the edit route above the other route is the only way to fix this. Routes are matched in a top-down fashion.

于 2012-07-10T02:02:56.413 回答