Displaying 20 results from an estimated 10000 matches similar to: "url_for generating URLs without relative root"
2006 Jun 22
2
[PLUGIN] url_for_with_prefix - allowing you to modify/remove prefixes easily
Here''s the readme. I think it''s okay to post this kind of thing to
the mailing list. Anyway, hopefully someone else finds this useful.
UrlForWithPrefix
================
By Pat Maddox
Very simple plugin, adds the :prefix option to url_for.
Say in your environment.rb file you''ve got
ActionController::AbstractRequest.relative_url_root = "/super"
Any time
2008 Jan 31
2
Facebooker and file_column
Facebooker URL Rewriter stuff overloads ActionController::AbstractRequest.relative_url_root, causing a conflict with the plugin file_column and possibly other utilities. file_column constructs image URLs using the server host and relative_url_root
This is not related to the sandbox patch I added to the rewriter. Facebooker overloaded relative_url_root before I touched it.
I''ve
2006 Jul 25
0
Bug in AbstractRequest.path() ?
ActionController::Routes.recognize() to obtain a URI for matching.
If ActionController::AbstractReqeust:;relative_url_root is non-zero length,
then the AbstractRequest::path chops that many characters off the request
URI before returning the new URI.
The problem is that this chopping happens whether or not the URI begins with
the relative URL.
I would expect the method to test whether the
2007 Oct 11
2
relative_url_root and javascript_include_tag
Hi. In my environment.rb, I have:
ActionController::AbstractRequest.relative_url_root = "/foobar"
In my layout, I have:
<%= javascript_include_tag :defaults %>
Question 1:
I am getting an error:
ActionController::RoutingError (no route found to match
"/javascripts/prototype.js" with {:method=>:get}):
When I remove the relative_url_root, everything works great.
2006 Aug 15
0
Using config.action_controller.asset_host with ActionController::AbstractRequest.relative_url_root
I''m looking for some help with an issue I''m having using an external
asset host. I''ve got the lines below in my environments/development.rb
file.
# Enable serving of images, stylesheets, and javascripts from an asset server
config.action_controller.asset_host = "http://assets.example.com"
#make rails think it lives in /app
2006 Aug 31
2
Url rewriting for random urls
Hello,
I have discovered the good use of stylesheet_link_tag and
javascript_include_tag (I''m still learning) and it is very useful because I
have to use the relative_url_root way.
Now I wonder how I can use that for other URLs. I want a background image
for a table cell so I have to write something like:
<td align=''right'' valign=''bottom''
2006 Apr 28
1
Apache proxy to lighttpd leads to Rails routing error
Hello,
I have an issue I am having trouble figuring out. I have a Rails app
running through lighttpd which is accessed through an Apache proxy.
My apache config:
<location /rails/>
ProxyPass http://localhost:81/
ProxyPassReverse http://localhost:81/
</location>
RewriteEngine On
RewriteRule ^/rails/(.*) http://localhost:81/$1 [P]
So when apache sees /rails/ it
2006 Jul 26
5
Mongrel + mod_proxy URL issues
We have a Centos server with a number of virtual hosts, and my rails app
runs under one of those virtual hosts using mongrel_rails. The app lives
in /home/mydomain/railsapp where /home/mydomain/railsapp/public is the
rails root.
It runs under mongrel on port 8008, so to get to it users invoke the url
http://www.mydomain.com:8008/ - all is fine to this point.
Now I have some users whose
2005 Dec 19
1
Deploying with Sub Directories
Hi, I am following this "tutorial" on dreamhost to deploy with sub
directories:
1. Upload your railsapp to ~/railsapp/.
** I have uploaded to /sharemyten.com/list/ (list is my railsapp folder)
2. Make all necessary changes mentioned in the QuickStart Guide above.
** Did this...
3. Create a symlink at the location you want the subdirectory that
points to ~/railsapp/public/:
$ cd
2006 Oct 22
2
url_for In a Component?
When I try to use url_for within a component I get the following:
NoMethodError in LinkController#get_links
undefined method `url_for'' for Navbar::LinkController:Class
The API docs show url_for as a public method of ActionController::Base.
Since my component is derived from ActionController::Base shouldn''t
url_for be available within the class?
Any ideas?
Thanks!
-
2006 Mar 06
7
Set base url?
I have an application running on a Lighttpd instance which is proxied by an
Apache server. It seems to work fine but my urls are incorrect: all urls
reference / which is not where my application runs at the Apache server.
How do I set the base url of a Rails application?
My Apache has the following proxy rules:
ProxyPass /hieraki http://localhost:3001
ProxyPassReverse /hieraki
2006 Mar 07
0
setting relative_url_root for static files in webrick
Hi,
I am using webrick and want my application not be available on
http://localhost:3000/ but http://localhost:3000/rails.
So I found out I can set
ActionController::AbstractRequest.relative_url_root = "/rails"
in environment.rb.
This works for controllers without further modifications. But for the
static files, I have to put a "rails" directory into the public
directory, and
2007 Nov 14
3
absolute urls in url_for vs. link_to
In both url_for and link_to, the :only_path param can be used to
determine whether the link url used is complete with hostname and path,
or just has the path (a kind of relative url).
However, in url_for it defaults to false (urls with hostnames), and in
link_to it defaults to true ( urls without hostnames, just paths).
Is there any reason for this discrepency? To me, it violates the
principle
2005 Dec 04
3
Relative URL
I''m trying to use a non default webserver with Rails and succesfully
does this by calling the disptacher directly, by setting the environment
variables: REQUEST_URI and SCRIPT_NAME
My problem is that the relative path is incorrect when I identify myself
as anything else than apache. In request.rb the @@relative_url_root is
only set when the webserver is apache. Is this default wanted
2006 Sep 07
5
url_for always escape string.
according to the documentation, only the url_for from ActionView escape
the
URL.
which happens on this line
escape ? html_escape(url) : url
and can be prevented by passing :escape =>
false to url_for.
still according to the documentation, the url_for from ActionController
is not supposed to escape the url.
BUT IT DOES.
at the moment of this line
escape ? html_escape(url) : url
url has
2006 Jan 12
3
url_for in tests
Hi there,
I''ve added an extra bunch of testing features for doing in-browser
testing with Selenium, and am having quite a time figuring out how to
use url_for with having a controller object present. I''ve tried using
ActionController::Base.url_for and
ActionView::Helpers::UrlHelper.url_for but haven''t been able to get
something that works.
What I want to be able
2007 Dec 21
3
Access url_for from rake task
How do I access ActionController:Base url_for method from a Rake task.
I tried to access ActionController from irb but it doesn''t work?
Check out the pasite http://pastie.caboo.se/131266
--
Anil
http://anilwadghule.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To
2006 Jul 06
0
Apache 2.0 proxy
This is the configuration I use with Apache v2.0. I don''t use virtual hosts.
This configuration lets Apache serve the images, javascripts, and stylesheets. ?
This means that the application needs to be installed on the Apache server as
wheel as the mongrel server(s) in multiple server environments. ?
If i wanted to flatten the resource directories I could avoid the rewrite
rules,
2006 May 25
0
(OT?) Rails App in Subfolder = Routing Error Recognition Failed
All,
I realize this was probably off-topic (not really mongrel-centric) -- my
apologies.
I "solved" the problem by appending to my Environment.rb:
ActionController::AbstractRequest.relative_url_root = "/RailsAppSample"
How come that doesn''t serve up the default "public/index.html" ? It caused a
Routing Error for "", so I added a temporary
2006 Aug 10
2
Mongrel servers running in a subdirectory behind a proxy
I was able to find some information about this in the list archives,
but it ended with a possible patch being submitted for Mongrel.
I tried to follow a few of the instructions, but I''m still kind of
stuck, since I''m not sure if what I''m seeing is the proper results. I
have an application running on a cluster of mongrel servers, which is
behind pen, which in turn is