file_field

file_field(name = "", size = 20, maxlength = nil)
Instance Public methods

Generate an File Upload Input element as a string.

The attributes of the element can be specified as three arguments, name, size, and maxlength. maxlength is the maximum length of the file's name, not of the file's contents.

Alternatively, the attributes can be specified as a hash.

See multipart_form() for forms that include file uploads.

file_field("name")
  # <INPUT TYPE="file" NAME="name" SIZE="20">

file_field("name", 40)
  # <INPUT TYPE="file" NAME="name" SIZE="40">

file_field("name", 40, 100)
  # <INPUT TYPE="file" NAME="name" SIZE="40" MAXLENGTH="100">

file_field("NAME" => "name", "SIZE" => 40)
  # <INPUT TYPE="file" NAME="name" SIZE="40">
doc_ruby_on_rails
2015-03-31 21:33:08
Comments
Leave a Comment

Please login to continue.