From the documentation the below route for edit and update will be like /comments/:id
resources :articles do
resources :comments, shallow: true
end
When I am updating comments and it doesn't know about articles how do you get back to the comments index? Do you get back to the articles index in such a case?
Is there an acceptable work around to get back to the list of comments after updating a comment when using shallow nesting?
Update My models use has_and_belongs_to_many association so I cannot do @comment.article to get the parent.
My models
class Venue < ApplicationRecord
has_and_belongs_to_many :users
end
class User < ApplicationRecord
has_and_belongs_to_many :venues
end
My route
resources :venues do
resources :accounts, shallow: true
end