开发者

How to perform rake after a create action?

I need to perform a rake after a create action开发者_JAVA技巧.

I have a .rake in my lib/tasks dir. How do I tell rails to run the rake after a create action?


You can call from your controller

system("rake_path your_command_here")

after create action. The system call returns true if successful.


You can call from your controller using two ways

 1. system("rake_path your_command_here")
 2. `rake_path your_command_here`


You can use

def create
  system "rake apn:notifications:deliver"
end
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜