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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Paul E. G. Lynch
2007-Apr-20 22:40 UTC
Re: column link to file, to do an file open or save as
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...". On Apr 20, 5:56 pm, idmkid <fpatterso...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---