class Forme::Formatter::Bs5ReadOnly

Formatter that adds “readonly” for most input types, and disables select/radio/checkbox inputs.

Registered as :bs5_readonly.

Private Instance Methods

_format_input(type) click to toggle source

Use a span with text instead of an input field.

Calls superclass method Forme::Formatter#_format_input
   # File lib/forme/bs5.rb
69 def _format_input(type)
70   @attr[:readonly] = :readonly
71   super
72 end
format_checkbox() click to toggle source

Disabled checkbox inputs.

Calls superclass method Forme::Formatter#format_checkbox
   # File lib/forme/bs5.rb
63 def format_checkbox
64   @attr[:disabled] = :disabled
65   super
66 end
format_radio() click to toggle source

Disabled radio button inputs.

Calls superclass method Forme::Formatter#format_radio
   # File lib/forme/bs5.rb
75 def format_radio
76   @attr[:disabled] = :disabled
77   super
78 end
format_select() click to toggle source

Use a span with text of the selected values instead of a select box.

Calls superclass method Forme::Formatter#format_select
   # File lib/forme/bs5.rb
81 def format_select
82   @attr[:disabled] = :disabled
83   super
84 end
format_textarea() click to toggle source

Use a span with text instead of a text area.

Calls superclass method Forme::Formatter#format_textarea
   # File lib/forme/bs5.rb
87 def format_textarea
88   @attr[:readonly] = :readonly
89   super
90 end