Closed jwoertink closed 11 years ago
Sorry, can you elaborate? Do you just want the path (i.e. /events/1)?
What I want is http://example.com/events/1
what I get is http://api.example.com/events/1
This happens regardless of having subdomain: nil
or not.
Are you saying this behaves as you expect when versionist is not in the picture, but does not work with versionist?
See this issue: https://github.com/rails/rails/issues/2025
Ah, I see what you mean. I'm on rails 2.3.11 now though. Do you know if this is still the same behavior?
Versionist works for you on Rails 2.3? That's surprising, since the dependency is setup to only work in Rails 3 and above.
https://github.com/bploetz/versionist/blob/master/versionist.gemspec#L21
Anyhow, I've never played with that :subdomain flag (didn't even know it existed until I Googled "rails url_for subdomain" about 15 minutes ago when you opened this ticket :-)), so I'm not sure what the scoop is with Rails 2.3.
Anyhow, it sounds like this issue has nothing to do with versionist, and was simply a Rails question? If so, can you close this ticket?
haha. Yeah, versionist is working great for us on 2.3.11 :) Yeah, I guess it's probably just a weird rails thing with the subdomain constraint. I'll close this, but if anyone else comes along, I just used
event_url(@event, host: request.domain)
It's an ugly hack, but it works well enough for now.
Thanks!
That's good to know. I'll add Rails 2.3 to the Travis testing matrix and see if it "just works". Thanks!
OH.. hahaha. I typed that wrong. oops. We are on 3.2.11 NOT 2.3.11.
Ok, good, because after I sat back and thought about it, I was baffled at how this would even work.
Nothing to see here, move along....... ;-)
I want to be able to share out public resource urls from within the API. I have an Event model, but when I do
I still get
http://api.example.com/events/1
How do I tell it that I don't want the subdomain added on?