There is a purchasing controller in our rails 3.1.0 app. A purchasing needs 4 approvals and we want to separate the approval from regular editing. What’s the best way to handle this approval? One way is to add 4 custom routes in purchasing controller for approval. Is there a way to build another controller such as purchasing_approve for handling the approval? If it does, how to construct the view, controller and declaration in routes.rb?
Thanks.
If the approval process just changes an attribute of the purchase model, I’d advise you to use a custom action in the purchase controller. Like this.
If the approval has it’s own table and it’s a more complex process, it makes sense to create another controller. The implementation though depends on how you want to show the process to the user.
If you describe the user experience you have in mind I could give you a more complete answer.