administrate icon indicating copy to clipboard operation
administrate copied to clipboard

Fix redirect after delete resource without index

Open edimossilva opened this issue 3 years ago • 5 comments

fix #626

Steps to reproduce

  • Resourse A has many Resource B
  • Resourse B has no index page
  • go to show page of Resourse A and click on destroy of Resource B
  • resource is destroyed

Behavior before this fix

  • An error is raised image

Behavior after this fix

  • is redirected Resourse A show page

edimossilva avatar May 11 '21 15:05 edimossilva

@pablobm

edimossilva avatar May 11 '21 16:05 edimossilva

Thank you @edimossilva!

I see why you had to create a new model MetaTagGroups. The way the example app is put together is not great. I'm currently working on a branch that will bring some order to this.

A few days before you, someone created a related PR: #1973. I think yours may complement it. I feel that, instead of creating this new query param origin_url, perhaps the same effect could be achieved by overriding after_resource_destroyed_path, as provided by the other PR. What do you think? If you think it makes sense, we should wait until the other PR is merged before rebasing yours on top.

Hi @pablobm , PR #1973 looks nice. I agree that the best way is overriding after_resource_destroyed_path. Let's wait for the merge of #1973 and rebase this one.

About the new model MetaTagGroups. Should I wait for your branch as well?

edimossilva avatar May 13 '21 16:05 edimossilva

I'd say let's wait for #1973 first and then let's see where my branch is when it arrives, and if we can use my branch to simplify your spec.

pablobm avatar May 13 '21 20:05 pablobm

This is the branch that reorganises the example app: https://github.com/thoughtbot/administrate/pull/1998. When it's merged, we can revisit this PR.

pablobm avatar Jun 18 '21 16:06 pablobm

This is the branch that reorganises the example app: #1998. When it's merged, we can revisit this PR.

@pablobm , please review, thanks!

edimossilva avatar Oct 23 '21 10:10 edimossilva

Closing due to lack of activity.

pablobm avatar Apr 18 '23 09:04 pablobm