Created
June 4, 2010 09:51
-
-
Save zuchmanski/425237 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Mam prosty middleware, który usuwa subdomenę "www" z requestów (zwykłe przekierowanie) - http://gist.github.com/425207 | |
| W przeglądarce wszystko działa wzorowo, problemy są z testami. | |
| [code=ruby]host! "example.com" | |
| root_url #=> "http://example.com/"[/code] | |
| Przykładowy scenariusz: | |
| - wejdź na new_post_url (przechodzi na "http://example.com/posts/new") | |
| - ... | |
| - kliknij "Create" (wysyła żądanie POST na "http://www.example.com/posts/"; jako, że jest www, rack przekierowuje na "example.com/posts" tylko, że zwykłym GETem). | |
| Jak zmusić cucumbera by korzystał wszędzie, konsekwentnie z "example.com"? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment