From b39dfd5936ef25b04d6caad3ceb048c68a79ea12 Mon Sep 17 00:00:00 2001 From: Joost Baaij Date: Tue, 21 Sep 2010 15:11:04 +0200 Subject: Document form_for behaviour when using file_field inside the block --- actionpack/lib/action_view/helpers/form_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers/form_helper.rb') diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 700a5a0ef1..3cc412de63 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -668,11 +668,13 @@ module ActionView InstanceTag.new(object_name, method, self, options.delete(:object)).to_input_field_tag("hidden", options) end - # Returns an file upload input tag tailored for accessing a specified attribute (identified by +method+) on an object + # Returns a file upload input tag tailored for accessing a specified attribute (identified by +method+) on an object # assigned to the template (identified by +object+). Additional options on the input tag can be passed as a # hash with +options+. These options will be tagged onto the HTML as an HTML element attribute as in the example # shown. # + # Using this method inside a +form_for+ block will set the enclosing form's encoding to multipart/form-data. + # # ==== Examples # file_field(:user, :avatar) # # => -- cgit v1.2.3