1602/express-on-railway — pull request #190 by SirUli (2012-07-23 07:39:29+00:00)
Title: select helper, changed checkbox and documentation of helper.js

Hello Anatoliy,

i'd like to push some things to railway, all related to helper.js
* Documentation according to JsDoc Toolkit guidelines
* Cleanup of examples
* Moved definition of "merged" further up to the other definitions
* Helper: checkbox
* Added "param" as additional parameter:
* Customized value possible
* "checked"
* If not defined as a parameter it works as previously (check if resource is set)
* If set, it is set as a parameter (enables to have "always checked" boxes)
* If set to Boolean false, check is not set (enables "always unchecked" boxes)
* All changes are backwards compatible
* Helper: select (See #188 for my first enquiry)
* Called with (name, options, params)
* Possible, optional fields for "params":
* blank: {STRING} Blank value to be added at the beginning of the list
* fieldname: {STRING} Sets the name of the field in "options" field where the displayed values can be found. Default: "value"
* fieldvalue: {STRING} Sets the name of the field in "options" field where the submitted values can be found. Default = fieldname
* multiple: Can be set to false if size >1 to only select one value.
* select: Select a value. If fieldname and fieldvalue are different, the value is compared with fieldvalue otherwise with fieldname.
* size: Sets the displayed size of the select field
* Examples:

```javascript
<%- form.select("state", states, {fieldname: 'name', select: item.state.name}) %>

<%- form.select("state", states, {fieldname: 'name', fieldvalue: '_id', select: item.state._id, size: 3, multiple: false}) %>

<%- form.select("state", states, {fieldname: 'name', fieldvalue: '_id', select: item.state._id, size: 3, blank:'Select status'}) %>
```