Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Parameters: {"utf8"=>"✓", "authenticity_token"=>"s0SqCQwVBFYYZudSRZ30/2fw4U1iiNPHqKe/8WI7lhI=", "doc"=>{"title"=>"asdasdd", "a"=>#<ActionDispatch::Http::UploadedFile:0x007fc313302e28 @tempfile=#<Tempfile:/var/folders/kq/j_tktbwx2m71cw2s6hm09rpw0000gn/T/RackMultipart20141124-23307-96wq57>, @original_filename="Untitled 2.numbers", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"doc[a]\"; filename=\"Untitled 2.numbers\"\r\nContent-Type: application/octet-stream\r\n">}, "commit"=>"Create"}
- ---------
- form
- <%= form_for @doc, :html => {:multipart => true} do |f| %>
- <p><%= f.text_field :title %></p>
- <p><%= f.file_field :data_file %></p>
- <%= f.submit "Create" %>
- <% end %>
- ------
- class Doc < ActiveRecord::Base
- belongs_to :course
- mount_uploader :data_file, DocFileUploader
- end
- -------
- create_table "docs", force: true do |t|
- t.string "title"
- t.string "path"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "data_file"
- end
Advertisement
Add Comment
Please, Sign In to add comment