Assume I have the following ActiveRecord class:
.........
store :skin_properties, accessors: [
:background_color,
:font_size,
:font_family,
:color
]
.........
This class saves values in the format shown below:
{"background_color"=>"#f2f2f2", "font_size"=>"20px", "font_family"=>"Verdana", "color"=>"#000000"}
How can I insert these values into an edit.haml file as inline CSS?
I attempted the following approach, however it did not work properly...
:sass
body
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="be93fecbcddbcc90cdd5d7d0">[email protected]</a>_properties.each_with_index do |(k,v)|
"#{k.gsub("_","-")}:#{v};"