Is it ok to instantiate an object in a View before passing it to a partial?
<%= render :partial => "trade_new", :locals => {:trade=>Trade.new("e", "b") } %>
Or is better to instantiate any objects in the Controller as instance variables:
@trade = Trade.new("e", "b")
and then pass the instance variable to a partial in the view like this:
<%= render :partial => "trade_new", :locals => {:trade => @trade } %>
My guess is it's better to instantiate new objects in the controller to avoid duplication - such as in a case where multiple templates may need to pass this new object to a partial from the same action.