I’m not sure what to do here. I have two scaffolds: Groups and Users. In two different Group views I’m listing group users and calling the Destroy method of the users_controller.
Since a 2nd view is now calling the destroy action, I need some way of detecting what view called the Destroy action because I need a different redirect and custom flash notice for each of the two group views.
Is there a simple way of solving this, or would the solution be something like making a copy of the Destroy method and mapping a new route for it?
-thanks!
edit: maybe this is a stupid idea, but I was thinking… For the two involved views, what if I stored their view names in the session when the views are generated (as a flag for the Destroy action to know which view to redirect to and what custom flash notice to send back)?
Pass the parameter with the links and check those parameters in your action.
Like ,
Controller: