Hi;
I got file_column working, but when I try
<%= image_tag url_for_file_column("artifact", "image")
%>
the resulting url generated is:
/unworld/unworld/artifact/image/1/dome.jpg
My document root for my rails application is
http://www.mydomain.com/unworld
and the true path to the image is
http://www.mydomain.com/unworld/artifact/image/1/dome.jpg
... so you can see that it appears to be appending the path_to_the_image
to the wrong document root. Can anybody suggest how I might begin to
debug this?
tia
-sporb
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
It''s a hack, but:
In file_column_helper.rb
def url_for_file_column(object_name, method, suffix=nil)
object = instance_variable_get("@#{object_name.to_s}")
relative_path = object.send("#{method}_relative_path", suffix)
return nil unless relative_path
url = ""
# sporb - comment out the following
# url << @request.relative_url_root.to_s << "/"
# sporb - add this line
url << "/"
url << object.send("#{method}_options")[:base_url] <<
"/"
url << relative_path
end
As I get better at this, i''ll, one day, know why... :)
-sporb
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---