# Referring to mp3 files not in a database

**URL:** <https://www.ruby-forum.com/t/referring-to-mp3-files-not-in-a-database/91631>\
**Category:** Rails\
**Created:** [April 10, 2007, 11:52pm UTC](https://www.ruby-forum.com/t/referring-to-mp3-files-not-in-a-database/91631 "2007-04-10T23:52:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [April 10, 2007, 11:52pm UTC](https://www.ruby-forum.com/t/referring-to-mp3-files-not-in-a-database/91631/1 "2007-04-10T23:52:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [April 10, 2007, 11:56pm UTC](https://www.ruby-forum.com/t/referring-to-mp3-files-not-in-a-database/91631/2 "2007-04-10T23:56:25Z")

</div>

send\_file(path, options…)

Store the path in your database and put the file someplace accessible  
by your application.

---

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [April 11, 2007, 12:00am UTC](https://www.ruby-forum.com/t/referring-to-mp3-files-not-in-a-database/91631/3 "2007-04-11T00:00:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [April 12, 2007, 12:47am UTC](https://www.ruby-forum.com/t/referring-to-mp3-files-not-in-a-database/91631/4 "2007-04-12T00:47:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [April 12, 2007, 10:01pm UTC](https://www.ruby-forum.com/t/referring-to-mp3-files-not-in-a-database/91631/5 "2007-04-12T22:01:07Z")

</div>

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 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.
