Sha256: 8dfb5c7bf2d5851c66f31c252db951e61ff040c579427b0c1f080b621e5b6a1b
Contents?: true
Size: 1.08 KB
Versions: 70
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true require "action_view" module Playbook module PbRadio class Radio include ActionView::Helpers::FormTagHelper include ActionView::Context include Playbook::Props partial "pb_radio/radio" prop :checked, type: Playbook::Props::Boolean, default: false prop :error, type: Playbook::Props::Boolean, default: false prop :input_options, type: Playbook::Props::Hash, default: {} prop :name, type: Playbook::Props::String, default: "radio_name" prop :text, type: Playbook::Props::String, default: "Radio Text" prop :value, type: Playbook::Props::String, default: "radio_text" def classname generate_classname("pb_radio_kit") + error_class end def selected "checked" if checked == true end def body_status error ? "negative" : nil end private def error_class error ? " error" : "" end end end end
Version data entries
70 entries across 70 versions & 1 rubygems