On Dec 2, 2010, at 11:18 AM, Tuishimi wrote:

> I'm not very clear.  I am sorry.  Here is what I am thinking:
> 
> 1. create a method (we'll call it summary_of_errors) on object [X]
> that performs some straight sql on my data that provides a summary of
> error_names and how many times that error occurred.
> 
> 2. add a <repeat attr="summary_of_errors">
> 3. in that repeat, generate a table against that data
> 
> But since this is a combination of data not really modeled, is that a
> problem?

The repeat tag will take pretty much anything that's "Array-like"; you can even 
repeat on a hash and you'll get values in 'this' and corresponding keys in 
'this_key'. The only issue with that is there's no guarantee what order the 
keys come out.

For an example, here's a page that uses a repeat on a bare array:

http://www.oab.org/jobs/job_postings

In the controller, this happens:

@job_postings = JobPosting.visible.jobs.group_by { |j| j.category }

Then in the view I repeat on the sorted keys of the @job_postings hash, since 
they need to be presented in alphabetical order.

--Matt Jones



-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to