Module: ModeratorHelper
- Defined in:
- app/helpers/moderator_helper.rb
Overview
Provides helper methods for use by views under ModeratorController
.
Instance Method Summary collapse
-
#text_bg(cls, content = nil, **opts) {|context| ... } ⇒ ActiveSupport::SafeBuffer
Display text on a specified background color.
Instance Method Details
#text_bg(cls, content = nil, **opts) {|context| ... } ⇒ ActiveSupport::SafeBuffer
Display text on a specified background color. For instance, if the background color is dark, consider passing a class for a light text color.
12 13 14 15 16 17 18 |
# File 'app/helpers/moderator_helper.rb', line 12 def text_bg(cls, content = nil, **opts, &block) if block_given? tag.span class: ["has-background-color-#{cls}", opts[:class]].join(' '), &block else tag.span content, class: ["has-background-color-#{cls}", opts[:class]].join(' ') end end |