Is there an easy way to have a column in MySQL link to a file within Ruby on Rails so that when the user is looking at the website, they can click on the data in the column and have it link to a file and choose to download or open the file? I am currently using active_scaffold. I am a newbie to Ruby on Rails. Thanks, Fred
on 2007-04-20 23:57
on 2007-04-21 00:42
If I understand you correctly, you have some files associated with the records in a table, and when the user is viewing the data for a record, you want to give them a link so that that they can download the file. Is that right? If so, I suppose you could store the file name in the table, make the file name available to your .rhtml file for the page showing the record, and then include some ERB code like: <a href="http://server:3000/path/to/data/dir/<%= @data_file_name %>">Download</a> That would bring it up in their web-browser, but they could right- click and choose "save link as...".