Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rails: Create File Download

Rails: Create File Download

Download Generated Data

send_data

# Inside controller action.

send_data data, filename

Download Existing File

send_file

# Inside controller action.

send_file "path/to/file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.