How to call expire_fragment from Rails Observer/Model?

前端 未结 8 867
长发绾君心
长发绾君心 2020-12-23 10:15

I\'ve pretty much tried everything, but it seems impossible to use expire_fragment from models? I know you\'re not supposed to and it\'s non-MVC, but surely there much be

8条回答
  •  抹茶落季
    2020-12-23 10:50

    I'm a bit of a rails noob, so this may not be correct, or even helpful, but it seems wrong to be trying to call controller actions from within the model.

    Is it not possible to write an action within the controller that does what you want and then invoke the controller action from within your rake task?

提交回复
热议问题