So this isn’t a question specific to Rails, but I wanted to keep the
purity of the MVC architecture as much as possible.
I have an AR model, order, which can have a status. I want to style
the orders based on what their status is. Right now all my status AR
model has is a name and I’m creating the CSS class in my view with
class="<%= order.status.name %>"
but I don’t like how coupled this makes everything. I’m sure people
have figured out a best practice for this. I was thinking maybe adding
a style attribute to Status? Anyone else have a better suggestion?