Делаю не-REST маршрутизацию в приложении Rails:
get "/:id" => "offers#show", as: :offer, constraints: { id: /\d/ }
get "/:region_slug" => "offers#index", as: :region_offers, constraints: { region_slug: /[a-z]/ }
get "/:region_slug/:id" => "offers#show", as: :region_offer, constraints: { region_slug: /[a-z]/, id: /\d/ }
get "/:region_slug/:scope_slug" => "offers#index", as: :region_scope_offers,
constraints: { region_slug: /[a-z]/, scope_slug: /[a-z]/ }
get "/:region_slug/:scope_slug/:id" => "offers#show", as: :region_scope_offer,
constraints: { region_slug: /[a-z]/, scope_slug: /[a-z]/, id: /\d/ }
Использую один из маршрутов в представлении:
= link_to category.name, region_scope_offers_path(@region.slug, category.slug)
Получаю такую ошибку:
ActionView::Template::Error (No route matches {:controller=>"offers", :action=>"index", :region_slug=>"region1", :scope_slug=>"category1", :format=>nil} missing required keys: [:region_slug, :scope_slug])
Подскажите, в чем может быть проблема?