def get_full_url(base_url)
return base_url + request.path + get_params_as_url_friendly
end
def get_params_as_url_friendly
count = 0
param_size = request.query_parameters.size
parameters = ""
for param in request.query_parameters
parameter = "#{param[0]}=#{param[1]}"
if count == 0
parameter = "?#{parameter}"
else
parameter = "{parameter}"
end
count += 1
parameters += parameter
end
return parameters
end
Tuesday, September 25, 2007
helper: Getting the full URL
There’s nothing built in Rails that gives you the full URL. I made a helper, that gives this to you. It doesn’t display properly here.
Subscribe to:
Post Comments (Atom)
2 comments:
you suck
What a dumb comment. Thanks a lot for contributing your article.
Post a Comment