Simple Link to Static File

richardhellyer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Wed, 22 Nov 2006 06:52:13 -0000

I have an application in which I create a file in the controller, and
then in the view I want to be able to provide a link to that file for
the user. (the file could be a .doc, or .pdf, say)

In the controller I do something like this:

@foo = ''foo.doc''
foofile = File.new(@foo, ''w'')
... write info to file, and then close it

In the view, I have tried every which way to provide a link
''foo.doc''
but without success.

For example, if I just put in the HTML for the file it gets resolved
something like "localhost:3000/foo.doc" and then I get an error
because
that isn''t an action.

many thanks in advance for any help you can give.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---