Sha256: b71c5e8833b2cf9c0b8b99cba2e21c3d6669def8723629dd35a1fe1801ddad55
Contents?: true
Size: 757 Bytes
Versions: 134
Compression:
Stored size: 757 Bytes
Contents
# frozen_string_literal: true require "action_view" module Playbook module PbToggle class Toggle include ActionView::Helpers::FormTagHelper include ActionView::Context include Playbook::Props partial "pb_toggle/toggle" prop :checked, type: Playbook::Props::Boolean, default: false prop :name prop :size, type: Playbook::Props::Enum, values: %w[sm md], default: "md" prop :value def classname generate_classname("pb_toggle_kit", size, checked_class) end def input check_box_tag(name, value, checked) end private def checked_class checked ? "on" : "off" end end end end
Version data entries
134 entries across 134 versions & 1 rubygems