Class: UI::SidebarRail
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::SidebarRail
- Includes:
- SidebarRailBehavior
- Defined in:
- app/components/ui/sidebar_rail.rb
Overview
Rail - Phlex implementation
Invisible rail on the sidebar edge for drag-to-expand interaction.
Instance Method Summary collapse
-
#initialize(classes: "", **attributes) ⇒ SidebarRail
constructor
A new instance of SidebarRail.
- #view_template ⇒ Object
Methods included from SidebarRailBehavior
#sidebar_rail_classes, #sidebar_rail_data_attributes, #sidebar_rail_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ SidebarRail
Returns a new instance of SidebarRail.
15 16 17 18 |
# File 'app/components/ui/sidebar_rail.rb', line 15 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#view_template ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/components/ui/sidebar_rail.rb', line 20 def view_template all_attributes = if @attributes.key?(:class) merged_class = TailwindMerge::Merger.new.merge([ all_attributes[:class], @attributes[:class] ].compact.join(" ")) all_attributes = all_attributes.merge(class: merged_class) end all_attributes = all_attributes.deep_merge(@attributes.except(:class)) (**all_attributes) end |