rails/rails — pull request #17273 by claudiob (2014-10-15 17:05:41+00:00)
Title: Fix how file_ and password_field_tag edit options

This commit fixes the behavior of `file_field_tag` and `password_field_tag` when invoked with a hash of options.

These two helpers are different from all the other ones in that they modify the options hash passed as a parameter, whereas all the other helpers duplicate it before updating it.

The result is that *bad things* can happen if the user re-uses the same hash.
For instance, users who write the following code to display a file field followed by a text field (both with the same class):

```rhtml
<% options = {class: 'important'} %>
<%= file_field_tag 'Upload', options %>
<%= text_field_tag 'Name', options %>
```

would instead see **two file fields!**

```html

```

This PR replaces `update` with `merge` in the code of the two helpers, fixing the issue above.