Sha256: 2c3ff52765e1bdf88497f646f14cc8fa79490f360f6602346ee9a725cf922584
Contents?: true
Size: 684 Bytes
Versions: 28
Compression:
Stored size: 684 Bytes
Contents
# frozen_string_literal: true module ActiveElement module Components # Navigation tabs component. class Tabs def initialize(controller, class_name:) @controller = controller @class_name = class_name @tabs = [] yield self end def to_s '' end def tab(title:, path:, &block) Tab.new(controller, title: title, path: path, &block).tap { |tab| @tabs << tab } end def template 'active_element/components/tabs' end def locals { tabs: tabs, class_name: class_name } end private attr_reader :tabs, :controller, :class_name end end end
Version data entries
28 entries across 28 versions & 1 rubygems