I will have a number of teachers each assigned a number of spots on a
The teachers name will be displayed each cell they are assigned and I
want the background display of each teacher to be a different color
which I will retrieve in the view and insert into an inline style.
I decided to make the background color an attribute of a teacher_day
model. I’ll assign colors shortly after I’ve created a collection of
teacher_days for a schedule.
here is a method I tried that doesn’t work
for teacher in @schedule.teacher_days
teacher.update_attributes( :bgcolor => cycle(“red”, “green”, “blue”)
The cycle doesn’t seem to work within the update attributes…saying that
it isnt a method for .
I would like to easily be able to expand or contract the number of items
in the color array. (I probably should keep it as a constant someplace