Created
September 9, 2010 21:46
-
-
Save therubymug/572648 to your computer and use it in GitHub Desktop.
This file contains 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
def path_to(page_name) | |
case page_name | |
when 'the homepage' | |
root_path | |
when /^the ([\w ]+) page$/ | |
send("#{$1.gsub(/\W+/, '_')}_path") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment