В моем тесте RSpec я делаю: delete recurring_events_path(@group, @recurring_event)
, но это дает DELETE "/groups/705777939/recurring_events.496
Как мне перевести аргументы в recurring_events_path
так, чтобы он вывел /groups/705777939/recurring_events/496
?
rout.rb
45 resources :groups, except: %i[new edit]
[snipp..]
56 scope "groups/:group_id" do
57 resources :posts, except: %i[new edit]
58 put "posts/:id/pin", to: "posts#pin"
59
60 resources :recurring_events, except: %i[show]
61 get "recurring_events/upcoming" => "recurring_events#upcoming", as: :upcoming
62 get "recurring_events/past" => "recurring_events#past", as: :past
63
64 scope "/posts/:post_id" do
65 resources :comments, except: %i[new edit]
66 end
67 end
$ рейк-маршруты
recurring_events GET /groups/:group_id/recurring_events(.:format) recurring_events#index
POST /groups/:group_id/recurring_events(.:format) recurring_events#create
PATCH /groups/:group_id/recurring_events/:id(.:format) recurring_events#update
PUT /groups/:group_id/recurring_events/:id(.:format) recurring_events#update
DELETE /groups/:group_id/recurring_events/:id(.:format) recurring_events#destroy