Fix file_column plugin to generate absolute URLs without falling over

in a heap and then use that in the user details view.
This commit is contained in:
Tom Hughes 2009-08-31 23:43:15 +00:00
parent 783748b1e5
commit e72ebb7eac
2 changed files with 2 additions and 4 deletions

View file

@ -12,9 +12,7 @@ xml.osm("version" => API_VERSION, "generator" => GENERATOR) do
:zoom => @user.home_zoom :zoom => @user.home_zoom
end end
if @user.image if @user.image
# i'd love to use "url_for_file_column, :absolute=>true", but that doesn't seem xml.tag! "img", :href => (url_for_file_column(@user, "image", :absolute => true))
# to work with the file_column plugin version we're using.
xml.tag! "img", :href => ("http://" + SERVER_URL + url_for_file_column(@user, "image"))
end end
if @user.languages if @user.languages
xml.tag! "languages" do xml.tag! "languages" do

View file

@ -76,7 +76,7 @@ module FileColumnHelper
return nil unless relative_path return nil unless relative_path
url = "" url = ""
url << request.relative_url_root.to_s if absolute url << request.protocol << request.host_with_port if absolute
url << "/" url << "/"
url << object.send("#{method}_options")[:base_url] << "/" url << object.send("#{method}_options")[:base_url] << "/"
url << relative_path url << relative_path