Calling an action in another controller
I have a situation like when i submit the employee form i need to check for a boolean value in employee_controller if it is set then i need to invoke a create action in AddressController. what is the best way to do it ? Whether i need to create开发者_如何学编程 an instance like AddressController .new and call the method ? and there is no relationship between employee and address.
Why do you need to call an action in AddressController when you submit and Employee form?
A better/cleaner idea might be to interact with the Address model from within the Employees_controller. Nothing wrong with that!
精彩评论