Sha256: 802bdb7c6c689a9a3b9f36c20deb24aadfde3bad5cafcdcfd31f9a2f0f69cdf9

Contents?: true

Size: 319 Bytes

Versions: 1

Compression:

Stored size: 319 Bytes

Contents

require 'erector'

class Dvl::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 '&times;'.html_safe
        span text v
      }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dvl-core-0.1.0 lib/dvl/components/flashes.rb