Class: Markaby::Builder
- Inherits:
-
Object
- Object
- Markaby::Builder
- Defined in:
- lib/reststop.rb
Instance Method Summary collapse
-
#form(*args, &block) ⇒ Object
Modifies Markaby’s ‘form’ generator so that if a ‘method’ parameter is supplied, a hidden ‘_method’ input is automatically added.
Instance Method Details
#form(*args, &block) ⇒ Object
Modifies Markaby’s ‘form’ generator so that if a ‘method’ parameter is supplied, a hidden ‘_method’ input is automatically added.
448 449 450 451 452 453 454 455 456 457 458 459 460 461 |
# File 'lib/reststop.rb', line 448 def form(*args, &block) = args[0] if args && args[0] && args[0].kind_of?(Hash) inside = capture &block if && .has_key?(:method) inside = input(:type => 'hidden', :name => '_method', :value => [:method]) + inside if [:method].to_s === 'put' || [:method].to_s == 'delete' [:method] = 'post' end end tag!(:form, || args[0]) {inside} end |