list animals with average capture_percent (Josh Susser's example)

R

richter.josef

Hi guys,

I implemented self-referential system based on Josh Susser's guidance
on http://blog.hasmanythrough.com/2007/10/ … ny-through

now I'm unsuccesfully trying to list all animals together with average
hunt.capture_percent, regardless of whether it is 'pursuit' or
'escape' (i am using it on sthg else than animals where it makes sense
not to differentiate between these. i want to keep having separated
'pursuit' and 'escape' for future though)

i tried sthg like

<%= (animal.pursuit.average:)capture_percent)
+animal.pursuit.average:)capture_percent))/2 %>

first, this doesn't work, while having just <%=
(animal.pursuit.average:)capture_percent) %> does

second, i believe this calculation should rather be included in
controller, but i have no idea how to do it over an array, join this
array with the array of @animals and send this all to view :-(

this might be rather stupid newbie question, but I failed to google
out an answer :-( thanks for any help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top