For each request you can only make one response. Sending a file is a response, so you can't do anything else - the view is not even being rendered.
If you want to display a page first, you need to create a new action to display html page and then another to send the file.
# controller
def download_file
send_file(
"#{Rails.root}/public/robots.txt",
filename: "robots.txt",
type: "application/txt"
)
end
def download
end
# view
<%= link_to 'Download', academics_download_file_path(:format => "txt") %>
Remember to update your routes as well (requires server restart)