Closed toydestroyer closed 9 years ago
not tested, but i think
def table_class
case self.current_state.to_sym
when :unreviewed
'warning'
when :accepted
'success'
when :rejected
'danger'
else
'info'
end
end
should work
It works! Thanks @nyon. And my apologies to everyone for such silly question.
I have a simple model:
I want to use
table_class
method to highlight rows in html table. But it always returnsinfo
.Is there any way to use
current_state
in case statement or i should useworkflow_state
directly from database?Thanks.