average of a whole table......at first I calculated avarage of eah column
then average of the average values but it is giving me an error- here are
my codes and error-
NoMethodError in Rate_schools#index
-3/app/views/rate_schools/index.html.erb* where line *#36* raised:
undefined method `+' for nil:NilClass
Extracted source (around line *#36*):
36: Average <%=((@avg1+@avg2+@avg3+@avg4+@avg5+@avg6+@avg7+@avg8)/8)%>
37: <% end %>
codes In controller:
codes in index :
<% if !@school.rate_schools.blank? %>
<td> library=<%=@avg1%> </td>
<% end %>
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/wUYDoovBR1UJ.
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to email@example.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.