Rails, How to render a view/partial in a model

前端 未结 10 1755
不思量自难忘°
不思量自难忘° 2020-12-22 18:55

In my model I have:

after_create :push_create

I push_create I need to render a view. I\'m trying to do that like so:

  def         


        
10条回答
  •  醉梦人生
    2020-12-22 19:27

    I have created a gist for this.
    I needed something similar, where the models don't necessarily (or in my case, ever) get updated via a controller, so the logic can't sit there.

    Created a server-push based controller:
    https://gist.github.com/4707055

提交回复
热议问题