This brought up a former problem of mine: I was not able to deploy a single rails app to an apache www-root subdirectory, because all the automatically generated links (link_to, actions, etc.) pointed at www.servername.com/action instead of www.servername.com/ochronus/rails_app/action. I couldn't find any workaround, and even "googling" was no good... Does anyone have an idea?
This brought up a former problem of mine: I was not able to deploy a single rails app to an apache www-root subdirectory, because all the automatically generated links (link_to, actions, etc.) pointed at www.servername.com/action instead of www.servername.com/ochronus/rails_app/action. I couldn't find any workaround, and even "googling" was no good... Does anyone have an idea?
You can use :application_prefix. You can even set this as a default rewrite option if all your rewrites needs to be made with this prefix. Example:
class ApplicationController
protected
def default_url_options(options)
{ :application_prefix => "ochronus/" }
end
end
Thanks for your help, I did what you adviced, but the result is weird.
At first load (first time it's opened in the browser) everything's fine, it generates good urls. Then if I click one of these hrefs, the second time the page loads, it seemingly adds the prefix _again_
This brought up a former problem of mine: I was not able to deploy a single rails app to an apache www-root subdirectory, because all the automatically generated links (link_to, actions, etc.) pointed at www.servername.com/action instead of www.servername.com/ochronus/rails_app/action. I couldn't find any workaround, and even "googling" was no good... Does anyone have an idea?
You can use :application_prefix. You can even set this as a default rewrite option if all your rewrites needs to be made with this prefix. Example:
Thanks for your help, I did what you adviced, but the result is weird.
At first load (first time it's opened in the browser) everything's fine,
it generates good urls. Then if I click one of these hrefs, the second
time the page loads, it seemingly adds the prefix _again_
Make sure to set the <base href=""> attribute in the HEAD section of
your rhtml template to http://www.all.hu . This should tell the
browser that paths all start relative to that directory, not whatever
the URL appears to be.
路路路
On Thu, 17 Feb 2005 05:51:18 +0900, Ochronus <ochronus@gmail.com> wrote:
Thank you,
Ochronus
David Heinemeier Hansson wrote:
>> This brought up a former problem of mine: I was not able to deploy a
>> single rails app to an apache www-root subdirectory, because all the
>> automatically generated links (link_to, actions, etc.) pointed at
>> www.servername.com/action instead of
>> www.servername.com/ochronus/rails_app/action. I couldn't find any
>> workaround, and even "googling" was no good... Does anyone have an idea?
>
>
> You can use :application_prefix. You can even set this as a default
> rewrite option if all your rewrites needs to be made with this prefix.
> Example:
>
> class ApplicationController
> protected
> def default_url_options(options)
> { :application_prefix => "ochronus/" }
> end
> end
> --
> David Heinemeier Hansson,
> http://www.basecamphq.com/ -- Web-based Project Management
> http://www.rubyonrails.org/ -- Web-application framework for Ruby
> http://www.loudthinking.com/ -- Broadcasting Brain
>
>
>
Instead of application_prefix, I rewrote action_prefix, like:
protected
def default_url_options(options)
{ :controller_prefix => "ochronus/" }
end
Thank you again for your help, David!
Regards,
Ochronus
Ochronus wrote:
路路路
Thanks for your help, I did what you adviced, but the result is weird.
At first load (first time it's opened in the browser) everything's fine, it generates good urls. Then if I click one of these hrefs, the second time the page loads, it seemingly adds the prefix _again_
This brought up a former problem of mine: I was not able to deploy a single rails app to an apache www-root subdirectory, because all the automatically generated links (link_to, actions, etc.) pointed at www.servername.com/action instead of www.servername.com/ochronus/rails_app/action. I couldn't find any workaround, and even "googling" was no good... Does anyone have an idea?
You can use :application_prefix. You can even set this as a default rewrite option if all your rewrites needs to be made with this prefix. Example:
Wow, that's a fine solution, thank you... I should have thought of it myself, it's pure html thank you! It's actually simpler to modify the prefix(es), but this is a surely working fallback solution if something goes wrong
It's good to have such helpful people in this community, I hope one day I can requite this
Regards,
Ochronus
Tanner Burson wrote:
路路路
Make sure to set the <base href=""> attribute in the HEAD section of
your rhtml template to http://www.all.hu . This should tell the
browser that paths all start relative to that directory, not whatever
the URL appears to be.
If I set up controller_prefix well, all links work as expected (have the good urls), BUT actions (such as form submits, editing, etc.) have the wrong url (since they don't have prefix). If I set action_prefix, it messes up everything, the scheme is as follows: