Rails: call another controller action from a controller

后端 未结 9 1042
眼角桃花
眼角桃花 2020-11-27 11:47

I need to call the create action in controller A, from controller B.

The reason is that I need to redirect differently when I\'m calling from controller B.

9条回答
  •  粉色の甜心
    2020-11-27 12:12

    Separate these functions from controllers and put them into model file. Then include the model file in your controller.

提交回复
热议问题