Paginate preserves multi-value parameters

When Paginate helper composes its navigation links, it includes request.params so that the next request will get the same parameters, in addition to the selected page number.

Some of these parameters can be an Array, for example if it came from a select multiple:

    <select name="myselect[]" multiple>

But in this case request.params contains the key 'myselect', not 'myselect[]'; and pointing to an Array, not to a String.

When creating its links, Paginate simply merges in the current request.params hash so the multi-value param is named 'myselect'. Because of this, when clicking navigation links, the following request.params['myselect'] won't provide an Array, but a single value.

This change fixes it by ensuring that the name of the parameters whose value is an Array end with '[]'.