Hi, In my controller, I do something like this: MyMailer.deliver_signup_notification(url_for(:subdomain => account.subdomain, :controller => ''hello'')) And a few lines later: redirect_to :action => ''index'' Much to my confusion, the redirect routes me to the subdomain used in the url_for. I''ve tried redirect_to :action => ''index'', :subdomain => nil Which changed nothing. It gets really strange when I try: redirect_to :action => ''index'', :subdomain => request.subdomains.first Only to find that request.subdomains.first now equals account.subdomain - which is NOT the case before the "MyMailer.deliver_signup_notification" method. So url_for changes the request object - which I personally dislike. Is there a work around for this? Thanks. Morten --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I may be way off here, I just wrote this test: def test_should_generate_correct_url original_url = url_for(:controller => "pages") url_with_subdomain = url_for(:controller => "pages", :subdomain => "test") latest_url = url_for(:controller => "pages") assert_equal original_url, latest_url end This passes and as far as I can see url_for doesn''t modify anything. Of course it may be something to do with a plugin you have. Can you try something similar and let us know the results? Also, it would be good to know which version of Rails you''re running. Cheers, Steve --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 19, 7:06 pm, "Steve Bartholomew" <s...-LWB5c3/XHbdBDgjK7y7TUQ@public.gmane.org> wrote:> I may be way off here, I just wrote this test: > > def test_should_generate_correct_url > original_url =url_for(:controller => "pages") > url_with_subdomain =url_for(:controller => "pages", :subdomain => > "test") > latest_url =url_for(:controller => "pages") > > assert_equal original_url, latest_url > end > > This passes and as far as I can seeurl_fordoesn''t modify anything. > Of course it may be something to do with a plugin you have. Can you > try something similar and let us know the results? Also, it would be > good to know which version of Rails you''re running.Thanks for the pointer Steven, it was indeed a broken plugin (url_for_domain). There''s a fixed version on the Wiki: http://wiki.rubyonrails.org/rails/pages/Url+for+domain But this has not made it to the plugin repository. Br, Morten --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---