Sha256: 66482697d524f2b2757384cf4a925709f8a0efb9b832e052cbfcf4d97655ef1c
Contents?: true
Size: 448 Bytes
Versions: 5
Compression:
Stored size: 448 Bytes
Contents
# frozen_string_literal: true module ApplicationHelper def bootstrap_class_for(flash_type) { success: "alert-success", error: "alert-danger", alert: "alert-warning", notice: "alert-info" }.stringify_keys[flash_type.to_s] || flash_type.to_s end def flash_messages flash.each do |flash_type, message| concat(content_tag(:div, message, class: "alert #{bootstrap_class_for(flash_type)}", role: 'alert')) end nil end end
Version data entries
5 entries across 5 versions & 1 rubygems