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
Constants inherited from GenericTagBrush
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
#callback_on, #get_oid, html_attr, #javascript_on, #oid, #onclick_callback, #onclick_javascript, #ondblclick_callback, #update_component_on, #update_on
Methods inherited from Wee::Brush
Constructor Details
#initialize ⇒ FormTag
Returns a new instance of FormTag.
375 376 377 378 |
# File 'lib/wee/html_brushes.rb', line 375 def initialize super(HTML_TAG) @attributes[:method] = HTML_METHOD_POST end |
Instance Method Details
#__callback ⇒ Object
390 |
# File 'lib/wee/html_brushes.rb', line 390 def __callback; action(@canvas.url_for_callback(@callback)) end |
#enctype_multipart ⇒ Object
Use this enctype when you have a FileUploadTag field.
371 372 373 |
# File 'lib/wee/html_brushes.rb', line 371 def enctype_multipart enctype('multipart/form-data') end |
#with(&block) ⇒ Object
380 381 382 383 384 385 386 |
# File 'lib/wee/html_brushes.rb', line 380 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 |