I'm attempting to apply a background color to my link based on the "bin.color" property, but I am encountering difficulties and cannot remember how I achieved it previously in my application. Here is what I have tried so far:
<%= link_to bin.label_name, linkbin_url(:id => bin.id), :class => "link", :style => bin.color %>
The above code successfully displays the link, but when I try to add a background color like this, it stops working:
<%= link_to bin.label_name, linkbin_url(:id => bin.id), :class => "link", :style => background-color:bin.color %>
I also attempted the following:
<%= link_to bin.label_name, linkbin_url(:id => bin.id), :class => "link", :style => 'background-color: bin.color !important' %>
However, none of these approaches seem to be effective.