# How make a link to html file

**URL:** <https://www.ruby-forum.com/t/how-make-a-link-to-html-file/159002>\
**Category:** Rails\
**Created:** [January 30, 2009, 10:01am UTC](https://www.ruby-forum.com/t/how-make-a-link-to-html-file/159002 "2009-01-30T10:01:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [January 30, 2009, 10:01am UTC](https://www.ruby-forum.com/t/how-make-a-link-to-html-file/159002/1 "2009-01-30T10:01:02Z")

</div>

Hi …  
i want to make link to html file.which i have in my rails application  
folder.  
below is my source genearted by html.  
but when i click the link i get error =\> Firefox doesn’t know how to  
open this address, because the protocol (d) isn’t associated with any  
program.  
  
click here

my actual code is\<%file\_path.each do |f|%\>

click here

\<%end%\>

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [January 30, 2009, 10:46am UTC](https://www.ruby-forum.com/t/how-make-a-link-to-html-file/159002/2 "2009-01-30T10:46:50Z")

</div>

Hi,

Do you really want to print links to local files?  
Well, you are missing a file:// in you href attribute.

ciao, tom

On Jan 30, 10:01 am, Newb N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [January 30, 2009, 11:18am UTC](https://www.ruby-forum.com/t/how-make-a-link-to-html-file/159002/3 "2009-01-30T11:18:05Z")

</div>

Thomas r. Koll wrote:

> Hi,
> 
> Do you really want to print links to local files?  
> Well, you are missing a file:// in you href attribute.
> 
> ciao, tom
> 
> On Jan 30, 10:01ï¿½am, Newb N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

thanks for the reply.i used like below.  
\<a href=“\<%= “file://”+ RAILS\_ROOT + f %\>”\> click here   
  
below is a source for above code.when i click the link it doesn’t show  
me any error but the file didn;t opened.waht would be the problem pls  
help.  
\<a  
D:/Projects/inProgress/ANGACM0908/re/Task/acm\_administration/ChatHistory/2009-01-05/removed\_email\_address@domain.invalid~Vs~removed\_email\_address@domain.invalid/removed\_email\_address@domain.invalid~Vs~removed\_email\_address@domain.invalid"\>  
click here
