add form text

master
Kanezoh 2021-06-17 15:49:46 +09:00
parent 23b2748e0f
commit c7f361a698
3 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
require "./form/field" require "./form/field"
require "./form/check_box"
require "./form/radio_button" require "./form/radio_button"
require "./form/check_box"
require "./form/text"
class MechanizeCr::Form class MechanizeCr::Form
getter fields : Array(FormContent::Field) getter fields : Array(FormContent::Field)
@ -78,6 +79,8 @@ class MechanizeCr::Form
checkboxes << FormContent::CheckBox.new(html_node, self) checkboxes << FormContent::CheckBox.new(html_node, self)
when "radio" when "radio"
radiobuttons << FormContent::RadioButton.new(html_node, self) radiobuttons << FormContent::RadioButton.new(html_node, self)
when "text"
fields << FormContent::Text.new(html_node)
else else
fields << FormContent::Field.new(html_node) fields << FormContent::Field.new(html_node)
end end

View File

@ -1,4 +1,3 @@
require "./radio_button"
class MechanizeCr::FormContent::CheckBox < MechanizeCr::FormContent::RadioButton class MechanizeCr::FormContent::CheckBox < MechanizeCr::FormContent::RadioButton
def check def check
@checked = true @checked = true

View File

@ -0,0 +1,2 @@
class MechanizeCr::FormContent::Text < MechanizeCr::FormContent::Field
end