aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 6ca956f879..0937075edf 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -211,7 +211,7 @@ module ActionView
# If you have an object that needs to be represented as a different
# parameter, like a Client that acts as a Person:
#
- # <%= form_for(@post, :as => :client do |f| %>
+ # <%= form_for(@post, :as => :client) do |f| %>
# ...
# <% end %>
#
@@ -228,8 +228,8 @@ module ActionView
# ...
# <% end %>
#
- # Where +@document = Document.find(params[:id])+ and
- # +@comment = Comment.new+.
+ # Where <tt>@document = Document.find(params[:id])</tt> and
+ # <tt>@comment = Comment.new</tt>.
#
# === Unobtrusive JavaScript
#
@@ -656,11 +656,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 <tt>multipart/form-data</tt>.
+ #
# ==== Examples
# file_field(:user, :avatar)
# # => <input type="file" id="user_avatar" name="user[avatar]" />