method
file_field
v2.1.0 -
Show latest stable
-
0 notes -
Class: ActionView::Helpers::FormHelper
- 1.0.0 (0)
- 1.1.6 (0)
- 1.2.6 (0)
- 2.0.3 (34)
- 2.1.0 (0)
- 2.2.1 (0)
- 2.3.8 (0)
- 3.0.0 (0)
- 3.0.9 (-1)
- 3.1.0 (6)
- 3.2.1 (1)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (38)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (12)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- 7.2.3 (1)
- 8.0.0 (0)
- 8.1.1 (0)
- What's this?
file_field(object_name, method, options = {})
public
Returns an 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.
Examples
file_field(:user, :avatar) # => <input type="file" id="user_avatar" name="user[avatar]" /> file_field(:post, :attached, :accept => 'text/html') # => <input type="file" id="post_attached" name="post[attached]" /> file_field(:attachment, :file, :class => 'file_input') # => <input type="file" id="attachment_file" name="attachment[file]" class="file_input" />

