Would it be ok to put an “average price” calculation, as below, in the view?
Or is this against MVC and is it better to do this in the controller?
<p>Average price: <%= @seller.total_sales / @seller.num_sales %></p>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Neither. Put it in the model. Then it becomes easy to unit test.