# Linking to new types of files from a rails app

**URL:** <https://www.ruby-forum.com/t/linking-to-new-types-of-files-from-a-rails-app/155336>\
**Category:** Rails\
**Created:** [December 10, 2008, 6:33pm UTC](https://www.ruby-forum.com/t/linking-to-new-types-of-files-from-a-rails-app/155336 "2008-12-10T18:33:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshualevy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@joshualevy](https://www.ruby-forum.com/u/joshualevy)\
**Post date:** [December 10, 2008, 6:33pm UTC](https://www.ruby-forum.com/t/linking-to-new-types-of-files-from-a-rails-app/155336/1 "2008-12-10T18:33:50Z")

</div>

I’m developing a RoR app that uses a custom file type. I’m using  
file\_column plugin to upload the files into my rails application, and  
that part works great. However I then need to render these files. I  
have an application that does this, and is designed to be run from the  
cgi directory. However, the integration between this cgi program and  
my rails application is not working. For example:

The following URL works, the abc file is rendered properly:  
[http://localhost/SimpleBow.abc](http://localhost/SimpleBow.abc)  
So that tells me that my Apache has the abc file type registered  
properly, and the abc program in the cgi directory runs properly.

The following URL gets me to the right file:  
\<%= link\_to “[http://localhost](http://localhost)”+url\_for\_file\_column(abctable,  
‘abc’).to\_s, “[http://localhost](http://localhost)”+url\_for\_file\_column(abctable,  
‘abc’).to\_s %\>  
So that tells me that the upload process is working.

However, it does not use the right rendering program from the cgi  
directory, and that is my problem.

If I print out the url\_for\_file\_column(abctable, ‘abc’) field, it does  
have the right relative path, including the proper file extention. I  
have tried using button\_to, and using localhost instead of localhost:  
3000, and just the relative path names. None of those things worked.

In rails, I have an object called abctable which has a string field  
called abc that contains the filename.

I configured Apache with this:  
Action application/x-httpd-abc /cgi-bin/abc2cgi  
AddType application/x-httpd-abc abc

Thanks for any help.

Joshua Levy
