We have a unique usecase for one of our customers who would like to display a string property dependent on it's value in different font-colors. This would require us to do something like this:
«car.color:if(val == 'green')»
«=car.color» but marked in green
«car.color:elsif(val == 'red')»
«=car.color» but marked in red
«car.color:endIf»
Of course it would be possible to create a getter method in rails that checks each color but since this is a really unique use case it wouldn't make any sense to hardcode this into our software logic.
We have a unique usecase for one of our customers who would like to display a string property dependent on it's value in different font-colors. This would require us to do something like this:
Of course it would be possible to create a getter method in rails that checks each color but since this is a really unique use case it wouldn't make any sense to hardcode this into our software logic.