class
Components::Examples::FormComponent
- Components::Examples::FormComponent
- Components::StatefulComponent
- Components::Component
- Reference
- Object
Overview
A form component with validation
Defined in:
components/examples/form_component.crClass Method Summary
Instance Method Summary
-
#field_changed(data : JSON::Any)
Handle field change
-
#render_content : String
Abstract method to be implemented by subclasses
-
#submit(data : JSON::Any | Nil = nil)
Handle form submission
Instance methods inherited from class Components::StatefulComponent
cacheable? : Bool
cacheable?,
changed? : Bool
changed?,
get_state(key : String) : JSON::Any | Nil
get_state,
mark_changed!
mark_changed!,
reset_changed
reset_changed,
reset_changed!
reset_changed!,
set_state(key : String, value : JSON::Any) : Nilset_state(key : String, value : String)
set_state(key : String, value : Int32)
set_state(key : String, value : Int64)
set_state(key : String, value : Float32)
set_state(key : String, value : Float64)
set_state(key : String, value : Bool)
set_state(key : String, value : Array(JSON::Any))
set_state(key : String, value : Hash(String, JSON::Any)) set_state, state : Hash(String, JSON::Any) state, state_to_json : JSON::Any state_to_json
Constructor methods inherited from class Components::StatefulComponent
new(**attrs)
new
Instance methods inherited from class Components::Component
<<(child : Component | Elements::HTMLElement | String | Elements::RawHTML) : self
<<,
[](name : String) : String | Nil
[],
[]=(name : String, value : String) : String
[]=,
add_children(*children : Component | Elements::HTMLElement | String | Elements::RawHTML) : self
add_children,
attributes : Hash(String, String)
attributes,
build(&block : self -> Nil) : self
build,
children : Array(Component | Elements::HTMLElement | String | Elements::RawHTML)
children,
component_id : String
component_id,
render : SafeHTML
render,
render_content : String
render_content,
render_safe_content : SafeHTML
render_safe_content,
to_raw_html : Elements::RawHTML
to_raw_html,
to_s(io : IO) : Nil
to_s
Constructor methods inherited from class Components::Component
new(**attrs)
new
Macros inherited from class Components::Component
component_css(css_string)
component_css
Class Method Detail
Instance Method Detail
def render_content : String
#
Description copied from class Components::Component
Abstract method to be implemented by subclasses