Class: ObjectView::Submit
- Defined in:
- lib/object_view/input.rb
Instance Attribute Summary
Attributes inherited from Element
#acceptable_children, #children, #single_line, #tag
Instance Method Summary collapse
-
#initialize(text = nil, name = nil) ⇒ Submit
constructor
A new instance of Submit.
- #label=(text) ⇒ Object
Methods inherited from Input
#name, #name=, #read_only, #read_only=, #type, #type=, #value, #value=
Methods inherited from Element
#<<, #add, #add_with_tag, #attr, #attributes, #css_class=, #find_element_with_tag, #id=, #is_acceptable_child?, #on_click=, #render, #render_attributes, #render_children, #style, #style=
Constructor Details
#initialize(text = nil, name = nil) ⇒ Submit
Returns a new instance of Submit.
205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/object_view/input.rb', line 205 def initialize(text = nil, name = nil) super() @tag = 'input' if (text != nil) self.attr('value', text) end self.attr('type', 'submit') if (name != nil) self.attr('name', name) end end |
Instance Method Details
#label=(text) ⇒ Object
218 219 220 |
# File 'lib/object_view/input.rb', line 218 def label= text self.add text end |