Class: Primrose::Components::HiddenField
- Defined in:
- lib/primrose/components/hidden_field.rb
Constant Summary collapse
- TEMPLATE =
<<~ERB <input type="hidden" name="<%= @name %>" value="<%= @value %>"> ERB
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Rose
#children, #event_handlers, #state
Instance Method Summary collapse
-
#initialize(name:, value:) ⇒ HiddenField
constructor
A new instance of HiddenField.
- #render ⇒ Object
Methods inherited from Rose
#add_child, #get_binding, #handle_error, #lifecycle, #on, #render_children, #trigger
Constructor Details
#initialize(name:, value:) ⇒ HiddenField
Returns a new instance of HiddenField.
10 11 12 13 |
# File 'lib/primrose/components/hidden_field.rb', line 10 def initialize(name:, value:) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/primrose/components/hidden_field.rb', line 8 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'lib/primrose/components/hidden_field.rb', line 8 def value @value end |