Change controller.action_name in Rails -


I am in an action on the rail, but I want to continue the process from within another action. My code looks like this Is:

  send (new_action) #call new_action method action_name = new_action #change controller Action_name render: action = & gt; New_action #inform that we are in new_action  

This works, but action_name - although it changes from within the ActionController frequency - reset is reset within viewing as < / P>

  controller.operation_name  

Is there any way to set it up and stick it?

Edit: I have found another solution which does not include this problem, which is. Thanks!

You're doing it incorrectly!

Around that kind of negligible action pac around you are guaranteed to suffer sooner or later, there is no guarantee that changes will not occur between those internal releases (and for themselves and others) ) It is difficult to maintain because you forget what it is doing and why, and there is a very real possibility of submitting subtle bugs. Instead, it is normal for both tasks and to keep it in a common method, such as a personal method in the controller, more logic in the model, or, if necessary, a general function in the legacy series of controllers. .


Comments