New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
named_url and url_for: subdomain => false doesn't work #2025
Comments
What kind of behaviour would you expect from |
Say you are on customer.mysite.com Using blogs_url would produces something like customer.mysite.com/blogs. While I want just mysite.com/blogs In rails 3, I had a url_for helper which got from this railscast - http://asciicasts.com/episodes/221-subdomains-in-rails-3 As shown in the cast, it used to work like this
However with 3.1 it doesn't work. |
It doesn't work in v3.1 because the railscast suggests to override rails's internal behaviour ( Anyway if you still need to follow this fragile path just change
You may also need to adjust
Tested with |
Railscast aside, I think it makes sense to expect that |
Your "subdomain" can mean many things. What if you have sub.domain.mydomain.com ? This is very specific behavior which should be implemented in a plugin. |
Have :subdomain => false to remove all subdomains is reasonable request. |
We should probably only keep |
@exviva Agreed! |
This was almost done with 2fe43b6 |
I think it's better to follow the
And so it's reasonable to add the same for |
Hello. I'm using Rails 3.1.0 and would find the In my application, at the moment Is there a work around in the pipeline? Would you recomment using @ksob's commit for the time being? Thanks! |
+1 for @ksob commit. For now it looks like you can get rid of subdomains with: root_url(:host => request.domain) |
@szimek - Thanks! Your hint |
…owing for subdomain(s) removal from the host during link generation. Closes rails#2025
…owing for subdomain(s) removal from the host during link generation. Closes rails#2025
…owing for subdomain(s) removal from the host during link generation. Closes rails#2025
I notice this fix has not made it into 3-1-stable - presumably that means it will be in 3.2? |
I'm having the same issue with 3.1 stable. I am unable to use the
|
Trying to use it as
In rails 3.1rc4
Apparently it has never worked.
The text was updated successfully, but these errors were encountered: