Ok this is probably a silly question, but is there some special way to link to files? I have a directory of files that I want my software to automatically display for download. These are forms of different types, some are PDFs, some are DOCs etc. When I click on the link I create, it appears to be going to the correct filename / url but I get the following error. no route found to match "/forms/filename.doc" with {:method=>:get} DO I need to use a specific type of link? I link_to the file as such. <%= link_to file[0, file.length-4], "forms/"+ file %> where file is the filename. Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Nov 7, 2007 11:36 AM, sw0rdfish <santia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Ok this is probably a silly question, but is there some special way to > link to files? > > I have a directory of files that I want my software to automatically > display for download. These are forms of different types, some are > PDFs, some are DOCs etc. > > When I click on the link I create, it appears to be going to the > correct filename / url but I get the following error. > > no route found to match "/forms/filename.doc" with {:method=>:get} > > DO I need to use a specific type of link? I link_to the file as such. > > <%= link_to file[0, file.length-4], "forms/"+ file %> > > where file is the filename.Where are the files? They should be in public/forms under your Rails application root. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
yeah I was reading from forms/ instead of public/forms I''m an idiot... Thanks Bob,. On Nov 7, 11:57 am, "Bob Showalter" <showa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Nov 7, 2007 11:36 AM, sw0rdfish <san...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Ok this is probably a silly question, but is there some special way to > > link to files? > > > I have a directory of files that I want my software to automatically > > display for download. These are forms of different types, some are > > PDFs, some are DOCs etc. > > > When I click on the link I create, it appears to be going to the > > correct filename / url but I get the following error. > > > no route found to match "/forms/filename.doc" with {:method=>:get} > > > DO I need to use a specific type of link? I link_to the file as such. > > > <%= link_to file[0, file.length-4], "forms/"+ file %> > > > where file is the filename. > > Where are the files? They should be in public/forms under your Rails > application root.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---