Class: Panda::Editor::Blocks::Alert

Inherits:
Base
  • Object
show all
Defined in:
lib/panda/editor/blocks/alert.rb

Instance Attribute Summary

Attributes inherited from Base

#data, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Panda::Editor::Blocks::Base

Instance Method Details

#renderObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/panda/editor/blocks/alert.rb', line 7

def render
  message = sanitize(data['message'])
  type = data['type'] || 'primary'

  html_safe(
    "<div class=\"#{alert_classes(type)} p-4 mb-4 rounded-lg\">" \
      "#{message}" \
    '</div>'
  )
end