Hello. In the directory that holds my site example.com, I have a symlink from example.com/html/backend to the public folder in my rails application. That public folder holds a folder called uploads which contains attachments that are sent there by the attachment_fu plugin. However, when I link to one of these files: <%= link_to "my_file_name", "/uploads/0000/0009/my_file.pdf" %> My browser sends me to example.com/uploads/0000/0009/my_file.pdf, instead of example.com/backend/uploads/0000/0009/my_file.pdf. That said, my javascript_include_tag and my stylesheet_link_tag work correctly and send me to the right subdirectories of my public folder: example.com/backend/javascripts/ and example.com/backend/stylesheets/. So how do these tag_helpers know where my javascript and stylesheet files are, and why doesn''t rails know that my public folder is at example.com/backend/ ? Any help would be very appreciated. Thanks, Eyal --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Use url_for Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 01/03/2009, at 6:03 AM, eyal <eyaldechter-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello. > > In the directory that holds my site example.com, I have a symlink from > example.com/html/backend to the public folder in my rails application. > That public folder holds a folder called uploads which contains > attachments that are sent there by the attachment_fu plugin. > > However, when I link to one of these files: > > <%= link_to "my_file_name", "/uploads/0000/0009/my_file.pdf" %> > > My browser sends me to example.com/uploads/0000/0009/my_file.pdf, > instead of example.com/backend/uploads/0000/0009/my_file.pdf. > > That said, my javascript_include_tag and my stylesheet_link_tag work > correctly and send me to the right subdirectories of my public folder: > example.com/backend/javascripts/ and example.com/backend/stylesheets/. > > So how do these tag_helpers know where my javascript and stylesheet > files are, and why doesn''t rails know that my public folder is at > example.com/backend/ ? > > Any help would be very appreciated. > > Thanks, > Eyal > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You mean:
<%= link_to my_filename, url_for("uploads/0000/0009/my_file.pdf")
%>
But this doesn''t change anything. How else could I use url_for to
access an object in the public directory?
Thanks,
Eyal
On Feb 28, 2:12 pm, Julian Leviston
<jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org>
wrote:> Use url_for
>
> Blog:http://random8.zenunit.com/
> Learn rails:http://sensei.zenunit.com/
>
> On 01/03/2009, at 6:03 AM, eyal
<eyaldech...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>
>
> > Hello.
>
> > In the directory that holds my site example.com, I have a symlink from
> > example.com/html/backend to the public folder in my rails application.
> > That public folder holds a folder called uploads which contains
> > attachments that are sent there by the attachment_fu plugin.
>
> > However, when I link to one of these files:
>
> > <%= link_to "my_file_name",
"/uploads/0000/0009/my_file.pdf" %>
>
> > My browser sends me to example.com/uploads/0000/0009/my_file.pdf,
> > instead of example.com/backend/uploads/0000/0009/my_file.pdf.
>
> > That said, my javascript_include_tag and my stylesheet_link_tag work
> > correctly and send me to the right subdirectories of my public folder:
> > example.com/backend/javascripts/ and example.com/backend/stylesheets/.
>
> > So how do these tag_helpers know where my javascript and stylesheet
> > files are, and why doesn''t rails know that my public folder
is at
> > example.com/backend/ ?
>
> > Any help would be very appreciated.
>
> > Thanks,
> > Eyal
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---