nickcharlton / administrate-field-nested_has_many

A plugin for nested has_many forms in Administrate
MIT License
59 stars 99 forks source link

Destroy button redirects to the nested resource index instead of redirecting to the parent resource show action #55

Closed pjmartorell closed 2 years ago

pjmartorell commented 2 years ago

Destroy button redirects to the nested resource index but in my opinion it would be better to redirect to the parent resource show action. That's because the nested resource is already being listed in the parent resource show view, so I prefer not to have the nested resource enabled in my routes.rb (resources :nested_resource, except: :index)

pjmartorell commented 2 years ago

I noticed I can customize the redirection in the Administrate controller of the nested resource overriding the destroy action of that controller. I hope it helps someone else.