I was wondering if it was correct to do the following in the model:
get_partial
#logic...
return "_partial_name1"
#more logic
return "_partial_name2"
#more logic
return "_partial_name3"
else
"_partial_name4"
end
end
and in the view :
<%= render @product.get_partial %>
There is NO erb code in the model, only logic choosing wich partial it should display. I tested it and it works, but I wanted to know if it is correct from an MVC point of view. If not, where should this logic be placed?