I want use html & css in form.text_area :text
<%= sanitize @post.text , tags: %w(table tr td div p span img), attributes: %w(id class style src) %>
But css attr “style” don’t work with background-image.
<div style="color:red; background-image: url('http://tra-ta-ta.com/1.jpg')">
text
</div>
Image don’t work. How I can use background-image?
Problem in sanitize.rb
def sanitize_css(style) # disallow urls style = style.to_s.gsub(/url\s*\(\s*[^\s)]+?\s*\)\s*/, ' ')
I just use raw without sanitize