title: Rails, How to render a view/partial in a model
body: <p>In my model I have: </p>
  
  <pre><code>after_create :push_create
  </code></pre>
  
  <p>I push_create I need to render a view. I'm trying to do that like so:</p>
  
  <pre><code>  def push_event(event_type)
      X["XXXXX-#{Rails.env}"].trigger(event_type, 
        {
          :content =&gt; render( :partial =&gt;"feeds/feed_item", :locals =&gt; { :feed_item =&gt; self })
        }
      )
    end
  </code></pre>
  
  <p>This angers rails as it doesn't like me rendering a view in the model but I need it there.</p>
  
  <p>Error:</p>
  
  <pre><code>NoMethodError (undefined method `render' for #&lt;WallFeed:0x1039be070&gt;):
  </code></pre>
  
  <p>Suggestions? Should I render it somewhere else somehow? Or how can I render in the model to set content? Thanks</p>