I have loops that loop through params values from a form and retrieve
records from the database and then plot a graph.
If the user selects a check box in the form the loop is 3 nested loops
instead of 5.
There is another checkbox that causes 5 loops (same as first case) but
does an extra calculation on the records in the inner loop.
My point is these 3 cases are similar: how should I deal with them?
At the moment the loops all occur in the controller - should I move them
to a model - a model for each graph type?
Or should I have one set of loops and do some clever conditional flow to
get all three cases out of it?
Any ideas on the best practice when doing loops?