Class: Protos::Collapse
- Inherits:
-
Component
- Object
- Phlex::HTML
- Component
- Protos::Collapse
show all
- Defined in:
- lib/protos/collapse.rb,
lib/protos/collapse/title.rb,
lib/protos/collapse/content.rb
Defined Under Namespace
Classes: Content, Title
Instance Method Summary
collapse
Methods inherited from Component
#initialize
Instance Method Details
#content ⇒ Object
37
|
# File 'lib/protos/collapse.rb', line 37
def content(...) = render Content.new(...)
|
#title ⇒ Object
35
|
# File 'lib/protos/collapse.rb', line 35
def title(*, **, &) = render Title.new(*, input_id: @input_name, **, &)
|
#view_template ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/protos/collapse.rb', line 18
def view_template
div(**attrs) do
if @input_type
input(
type: @input_type,
id: @input_name,
name: @input_name,
autocomplete: :off,
form: ""
)
end
yield if block_given?
end
end
|