I have the following nested singular route:
resources :listings do
resource :logo, only: [ :edit, :update ]
end
It generates 2 correct routes as expected:
edit_listing_logo GET /listings/:listing_id/logo/edit(.:format) logos#edit
listing_logo PUT /listings/:listing_id/logo(.:format) logos#update
Now when I redirect to edit_listing_logo_path
redirect_to edit_listing_logo_path( @listing, @logo )
or when I create an update form
<%= form_for [ @listing, @logo ] do |f| %>
the resulting link has always singular resource ID attached at the end like this
/listings/2/logo.1
I'm not using respond formats in this app yet so it's working fine. But this link generation seems strange and I expect it to cause problems if used with various respond formats.
Note, that this was also discussed here Rails Nested Singular Resource Routing but I'm not using 'show' path at all.
Thanks for any inputs.