Forum: Ruby on Rails rails helpers are adding extra folders

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Josh K. (Guest)
on 2007-01-22 22:14
(Received via mailing list)
i have a new rails site that i am setting up just like i normally do
with
all of the other sites. i created a subdomain which is pointed to a
subfolder in my public_html.

i can view the site both at test.mywebsite.com and mywebsite.com/test/
but
when i view it by the subdomain, rails helpers are adding the /test/ to
all
of my resources, so none of my images or style sheets are found.

this hasn't ever happened to be before, so i'm not sure what to do. is
there
something else i have to add in my .htaccess file?
Xavier N. (Guest)
on 2007-01-22 22:42
(Received via mailing list)
On Jan 22, 2007, at 9:13 PM, Joshua Kieschnick wrote:

> i have a new rails site that i am setting up just like i normally
> do with all of the other sites. i created a subdomain which is
> pointed to a subfolder in my public_html.
>
> i can view the site both at test.mywebsite.com and mywebsite.com/
> test/ but when i view it by the subdomain, rails helpers are adding
> the /test/ to all of my resources

By default helpers create absolute paths

   /images/foo.png

So the subdomain is the one that should work out of the box. Are you
using custom options for them?

-- fxn
Josh K. (Guest)
on 2007-01-22 23:14
(Received via mailing list)
not that i know of. i've set up apps on subdomains several times before
too and they've all worked which is why i don't understand how it's
prefixing all my links with /test/
Josh K. (Guest)
on 2007-01-22 23:19
(Received via mailing list)
just for kicks, i just tried to symlink my app to the root folder and
it didn't add the test prefix, only when it's accessed by the subdomain.
Xavier N. (Guest)
on 2007-01-22 23:33
(Received via mailing list)
On Jan 22, 2007, at 10:13 PM, Josh wrote:

> not that i know of. i've set up apps on subdomains several times
> before
> too and they've all worked which is why i don't understand how it's
> prefixing all my links with /test/

Have you set RAILS_RELATIVE_URL_ROOT? Can you check your rewrite
rules, if any?

-- fxn
Josh K. (Guest)
on 2007-01-22 23:41
(Received via mailing list)
i had an admin restart the server, and now the urls are working right.
weird.

do they get locked in when the app starts even when it's not in
production?
This topic is locked and can not be replied to.