Forum: Ruby on Rails linking to new types of files from a rails app

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
joshualevy (Guest)
on 2008-12-10 19:33
(Received via mailing list)
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
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"+url_for_file_column(abctable,
'abc').to_s, "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
This topic is locked and can not be replied to.