Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. Class
  2. def uploadfile
  3. # render :text => request.headers['X-File']
  4. render :text => env.inspect
  5. end
  6. end
  7.  
  8. View Haml
  9. = form_for :file, url: '/uploadfile', html: { multipart: true } do |f|
  10. = file_field_tag 'uploaded_files[]', required: true
  11. = f.submit 'Save'
  12. end
  13.  
  14. Route
  15. Rails.application.routes.draw do
  16. resources :files
  17. root 'files#index'
  18. match '/uploadfile' => 'files#uploadfile', via: [:get, :post]
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement