DEV Community

Discussion on: Beginner's guide to strong params and validations

Collapse
 
ridhwaans profile image
ridhwaans • Edited

What if you want Postman to send a CSV file in POST with strong parameters?
for example:

class ProcessorController < ApplicationController
def create
...
end
private
def processor_params
    params.require(:upload).permit(:file)
end
end
...
post '/processor', params: {
     upload: {
         file: fixture_file_upload('report.csv', 'text/csv')
     }
}
Enter fullscreen mode Exit fullscreen mode

how do you make it work in postman?