Skip to content

Instantly share code, notes, and snippets.

@aeden
Created May 18, 2010 21:02
Show Gist options
  • Save aeden/405544 to your computer and use it in GitHub Desktop.
Save aeden/405544 to your computer and use it in GitHub Desktop.
# within the else block in paths.rb:
path_method = page_name.gsub(/^(the|my) /i, '').gsub(/ page$/i, ' path').gsub(/\s+/, '_')
begin
send(path_method.to_sym)
rescue
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
"Now, go and add a mapping in #{__FILE__}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment