Class: Wee::Brush::FormTag
- Inherits:
-
GenericTagBrush
- Object
- Wee::Brush
- GenericTagBrush
- Wee::Brush::FormTag
- Defined in:
- lib/wee/renderer/html/brushes.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Wee::Brush
Instance Method Summary collapse
-
#initialize ⇒ FormTag
constructor
A new instance of FormTag.
- #onsubmit_update(update_id, symbol = nil, *args, &block) ⇒ Object
- #with(*args, &block) ⇒ Object
Methods inherited from GenericTagBrush
#__action_callback, #__actionurl_callback, #__actionurl_named_callback, #__input_callback, #css_class, #css_class_for, #method_missing, #onclick_callback, #onclick_update
Methods inherited from Wee::Brush
Constructor Details
#initialize ⇒ FormTag
Returns a new instance of FormTag.
544 545 546 547 |
# File 'lib/wee/renderer/html/brushes.rb', line 544 def initialize super('form') @attributes['method'] = 'POST' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Wee::Brush::GenericTagBrush
Instance Method Details
#onsubmit_update(update_id, symbol = nil, *args, &block) ⇒ Object
555 556 557 558 559 |
# File 'lib/wee/renderer/html/brushes.rb', line 555 def onsubmit_update(update_id, symbol=nil, *args, &block) raise ArgumentError if symbol and block url = @canvas.url_for_callback(to_callback(symbol, args, block), :live_update) onsubmit("javascript: new Ajax.Updater('#{ update_id }', '#{ url }', {method:'get', parameters: Form.serialize(this)}); return false;") end |
#with(*args, &block) ⇒ Object
561 562 563 564 565 566 567 |
# File 'lib/wee/renderer/html/brushes.rb', line 561 def with(*args, &block) # If no action was specified, use a dummy one. unless @attributes.has_key?('action') @attributes['action'] = @canvas.build_url end super end |