Class: RailComponent

Inherits:
Component show all
Includes:
Positionable
Defined in:
app/components/rail_component.rb

Overview

Rail — content rails floating alongside main content.

Usage:

Rail(position: :left) { text "Side content" }
Rail(position: :right, close: true) { text "Close rail" }

Constant Summary

Constants inherited from Component

Component::HTML_OPTIONS

Instance Method Summary collapse

Methods inherited from Component

default, #initialize, #render_in, slot

Constructor Details

This class inherits a constructor from Component

Instance Method Details

#to_sObject



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/components/rail_component.rb', line 18

def to_s
  classes = class_names(
    "ui",
    position,
    { "close" => close,
      "attached" => attached,
      "dividing" => dividing,
      "internal" => internal },
    "rail"
  )

  tag.div(class: classes) { @content }
end