Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - Class
- def uploadfile
- # render :text => request.headers['X-File']
- render :text => env.inspect
- end
- end
- View Haml
- = form_for :file, url: '/uploadfile', html: { multipart: true } do |f|
- = file_field_tag 'uploaded_files[]', required: true
- = f.submit 'Save'
- end
- Route
- Rails.application.routes.draw do
- resources :files
- root 'files#index'
- match '/uploadfile' => 'files#uploadfile', via: [:get, :post]
- end
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment                    
                 
                    