开发者

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜