I currently have this in my routes.rb :
namespace :api
namespace :v1
namespace :me
# ...
resources :offers do
resources :state, only: %i(index)
end
end
end
end
This gives me this route :
GET v1/me/offers/:offer_id/state(.:format)
api/v1/me/state#index
But the route I would like to have is this one :
GET v1/me/offers/:offer_id/state(.:format)
api/v1/me/offers/state#index
Simply put, I want to be able to place my state_controller.rb in an offers folder, without changing the path to access it.
How can I achieve that ?