-
-
Save psahni/1122051 to your computer and use it in GitHub Desktop.
Static named redirect routes in Rails 3
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
<ul class="social-links"> | |
<li class="facebook"><%= link_to "Like us on Facebook", facebook_path %></li> | |
<li class="twitter"><%= link_to "Follow us on Twitter", twitter_path %></li> | |
</ul> |
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
Myapplication::Application.routes.draw do | |
match "/facebook" => redirect("http://www.facebook.com/pages/MarkZuckerbergFanClub/12345678"), :as => 'facebook' | |
match "/twitter" => redirect("http://twitter.com/TweetyMcTweet"), :as => 'twitter' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment