Class: Relevance::Tarantula::Form
- Extended by:
- Forwardable
- Defined in:
- lib/relevance/tarantula/form.rb
Instance Method Summary collapse
- #action ⇒ Object
-
#initialize(tag) ⇒ Form
constructor
A new instance of Form.
- #method ⇒ Object
- #rails_method_hack ⇒ Object
Constructor Details
#initialize(tag) ⇒ Form
Returns a new instance of Form.
5 6 7 |
# File 'lib/relevance/tarantula/form.rb', line 5 def initialize(tag) @tag = tag end |
Instance Method Details
#action ⇒ Object
9 10 11 |
# File 'lib/relevance/tarantula/form.rb', line 9 def action @tag['action'].downcase end |
#method ⇒ Object
13 14 15 |
# File 'lib/relevance/tarantula/form.rb', line 13 def method (rails_method_hack or @tag['method'] or 'get').downcase end |
#rails_method_hack ⇒ Object
17 18 19 |
# File 'lib/relevance/tarantula/form.rb', line 17 def rails_method_hack (tag = @tag.at('input[@name="_method"]')) && tag["value"] end |