Hobo / hobo

The web app builder for Rails (moved from tablatom/hobo)
http://hobocentral.net
103 stars 39 forks source link

Need to restore support for passing additional form parameters as attribute to <form> #15

Open enwood opened 11 years ago

enwood commented 11 years ago

Up to Hobo 1.3, we used to be able to pass additional form parameters as an attribute to the <form> tag, as follows:

<form web-method="addparcel" method="POST" params="&{'document_id' => this.id}" update="parcels-div" message="Searching..." refocus-form>

Bryan, you mentioned that this requires javascript support but wasn't something ported from prototype.js to jquery.

bryanlarsen commented 11 years ago

The standard way to add additional form parameters is to add hidden fields inside the form

<hidden-field:document_id/> or <input name="document_id" value="&this.id" type="hidden"/>

In 1.3 params only worked for Ajax forms. That's not easy or appropriate to add to 2.0, although it's probably not to difficult to add support for params to all forms by adding them as hidden fields.

enwood commented 11 years ago

Agreed. Easier than including them as attributes to the tag (and dealing with the unusual syntax of doing so).

bryanlarsen commented 11 years ago

reopening as a doc bug. If we're not going to fix the regression in code, at least it should be noted in CHANGES.