class Dvl::Core::Components::Flashes < Erector::Widget needs :flash def content @flash.select { |k, v| k.to_s.in?(%w(success error info)) && v.present? }.each do |k, v| div(class: "flash flash_#{k}") { a.flash_close '×'.html_safe span text v } end end end