Class: Wee::Brush::FormTag
- Inherits:
-
GenericTagBrush
- Object
- Wee::Brush
- GenericTagBrush
- Wee::Brush::FormTag
- Includes:
- CallbackMixin
- Defined in:
- lib/wee/html_brushes.rb
Overview
Form
Constant Summary collapse
- HTML_TAG =
'form'.freeze
- HTML_METHOD_POST =
'POST'.freeze
Instance Attribute Summary
Attributes inherited from Wee::Brush
Instance Method Summary collapse
- #__callback ⇒ Object
-
#enctype_multipart ⇒ Object
Use this enctype when you have a FileUploadTag field.
-
#initialize ⇒ FormTag
constructor
A new instance of FormTag.
- #with(&block) ⇒ Object
Methods included from CallbackMixin
#call, #callback, #callback_method
Methods inherited from GenericTagBrush
#get_oid, html_attr, #oid, #onclick_callback, #onclick_javascript, #onclick_update_callback, #onclick_update_self_callback, #ondblclick_callback
Methods inherited from Wee::Brush
Constructor Details
#initialize ⇒ FormTag
Returns a new instance of FormTag.
328 329 330 331 |
# File 'lib/wee/html_brushes.rb', line 328 def initialize super(HTML_TAG) @attributes[:method] = HTML_METHOD_POST end |
Instance Method Details
#__callback ⇒ Object
343 |
# File 'lib/wee/html_brushes.rb', line 343 def __callback; action(@canvas.url_for_callback(@callback)) end |
#enctype_multipart ⇒ Object
Use this enctype when you have a FileUploadTag field.
324 325 326 |
# File 'lib/wee/html_brushes.rb', line 324 def enctype_multipart enctype('multipart/form-data') end |
#with(&block) ⇒ Object
333 334 335 336 337 338 339 |
# File 'lib/wee/html_brushes.rb', line 333 def with(&block) # If no action was specified, use a dummy one. unless @attributes.has_key?(:action) @attributes[:action] = @canvas.build_url end super end |