My Haml file looks like :-
.playing-card-container
.card-image
The CSS class for .card-image is
.card-image {
width: 68px;
height: 68px;
margin-bottom: 1em;
background-image: image-url('some-url');
background-repeat: no-repeat;
background-position: center;
background-size: cover;
border-radius: 50%;
}
The haml file gets an image object from a rails server, and I want to dynamically change the background image for .card-image class. I know how to dynamically add classes or ids but how can we change a certain css attribute? I will appreciate if you can provide any help.