Class: Decidim::AnnouncementCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::AnnouncementCell
- Includes:
- SanitizeHelper
- Defined in:
- decidim-core/app/cells/decidim/announcement_cell.rb
Overview
This cell renders an announcement
The `model` is expected to be a Hash with two keys:
- `body` is mandatory, its the message to show
- `title` is mandatory, a title to show
title: "...", # mandatory
body: "..." # mandatory
It can also receive a single value to show as text. It can either be a String or a value accepted by the `translated_attribute` method.
As options, the cell accepts a Hash with these keys:
- `callout_class`: The Css class to apply. Default to `"secondary"`
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
24 25 26 27 28 |
# File 'decidim-core/app/cells/decidim/announcement_cell.rb', line 24 def show return if clean_body.blank? && clean_announcement.blank? render :show end |