A pointer in the right direction needed please!
I’m still getting my first app going, so this i believe should be a
fairly simple problem.
My Rails (3.0.0) app displays tables of events, with columns for Date /
Band / venue / image etc.
Currently it display the data in date order, which is great, but I’d
also like to colour the table rows according to whether the date is old,
within the next month, or after 1 month from now.
I imagine I’ll want to make a differnt css class for each of these, with
but where in the code should I put the logic that determines which css
class to use depending on the date?
The view that displays the data is a simple table that goes through the
|Date||Image||Event Name||Band Name||Venue||Description|
|<%= event.eventDate.to_formatted_s(:short) %>||<%=h image_tag event.photo.url(:thumb) %>||<%=h event.eventName %>||<%=h event.bandName %>||<%=h event.venue %>||<%=h event.description %>||<%= link_to 'Show', event %>||<%= link_to "Edit", polymorphic_path(event, :action => :edit) %>||<%= link_to "Delete", event, :method => :delete, :confirm => 'Are you sure?', :title => "Delete Event" %>|
should the logic to change row color be in here somehow?
Thanks in advance!