Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4376

Show
Ignore:
Timestamp:
05/29/06 00:05:41 (4 years ago)
Author:
david
Message:

Expanded :method option in FormTagHelper#form_tag, FormHelper#form_for, PrototypeHelper#remote_form_for, PrototypeHelper#remote_form_tag, and PrototypeHelper#link_to_remote to allow for verbs other than GET and POST by automatically creating a hidden form field named _method, which will simulate the other verbs over post [DHH]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/railties/html/javascripts/prototype.js

    r4182 r4376  
    670670    if (parameters.length > 0) parameters += '&_='; 
    671671 
     672    /* Simulate other verbs over post */ 
     673    if (this.options.method != 'get' && this.options.method != 'post') { 
     674      parameters += (parameters.length > 0 ? '&' : '') + '_method=' + this.options.method 
     675      this.options.method = 'post' 
     676    } 
     677 
    672678    try { 
    673679      this.url = url;