noob question on active record

Hi all,

Sorry if this is too obvious for most, but I am new to rails and ruby in general, so basically at lost at what I can do. Here is the set up.

I've set up a parent and child relation (ie. parent "has many" child). The child object has these attributes (id, name, day, period....), where day is a fix set of string (monday, tuesday, ... sunday) and period is all a fix set of string like (morning, noon, night). I am using the this plugin for enum attributes for day and periods, https://github.com/jeffp/enumerated_attribute#readme

What I want to do in rails is print out all the child of a parent in the following formatted table.

Monday

Hej Herman,

did you take a look at the group method.

http://guides.rubyonrails.org/active_record_querying.html#group

I bet you can do it easier.

Best,

Sebastian

Hi Sebastian,

I did try group on activerecord, what I did was group by "day". However, after that, how do I print out the table I layout before?