I'm using rails and I'm wondering if what I'm trying to do is possible with html tables. I'm iterating over an object that has many categories. Each category has one or more books and each book as a "pages" attribute. I'd like to create a table that looks like this:
**category** **book name** **pages**
general book1 15
book2 20
book3 40
I believe this would correspond to one row in the table, but the last two columns obviously have multiple rows within them. I've been able to accomplish this with code that looks like:
categorybook namepages
As you can see, I'm iterating over the c.books twice, which seems messy. Is there a way for me to do this while iterating over c.books just once? I'd love to hear any suggestions.