I want to take action from another controller of an administrator.
How can I do this?
A few years ago, there were helpful, but they are no longer available.
Best Relationship
You do not call the action method of any other controller Can.
You have only two solutions
Redirecting to the appropriate URL.
redirect_to '/'
But of course if you have data from a form, then you lose them.
Any other controller.
Render 'Controller / Action'
You will keep all your defined data (parameters and everything).
But all you need to do again is what other controllers will do.
There will be a solution to avoid repetitive code lines that you define each wars in a manner that is in your approach, and use this method in two of your controllers.
No comments:
Post a Comment