Where I can place mp3 files that I would like to have a link to within one of my views? The catch is that I do not want to create a database for these files, I just want to refer to them within the application folders. Thanks
on 2007-04-10 23:52
on 2007-04-10 23:56
send_file(path, options...) Store the path in your database and put the file someplace accessible by your application.
on 2007-04-11 00:00
So there is no way to just create a plain link on one of the views to an mp3 file without involving databases? I would prefer to just create a link that would directly open up a quicktime window.
on 2007-04-12 00:47
Just hard code the path, if you don't want to use a database. Put it in a variable, and use the variable in the send_file() call.
on 2007-04-12 22:01
Wait a second. Are you saying this is simply a static hyperlink to a static file on your web server? That's called a "hyperlink." You can write one using an HTML <a href="http://www.domain.com/>A link to a file</a> tag. You don't need Rails for that. However, if you really feel compelled to dynamically generate your static tag, you can use ActionView's tag or content_tag helpers I suppose.