Skip to content

Instantly share code, notes, and snippets.

@wmoxam
Created September 30, 2008 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wmoxam/13842 to your computer and use it in GitHub Desktop.
Save wmoxam/13842 to your computer and use it in GitHub Desktop.
%w{ asian american european african australian }.each do |p|
map.with_options :controller => :people, :people => p do |person|
person.send(p.pluralize) p.pluralize, :action => :index, :conditions => {:method => :get}
person.send(p) p, :action => :show, :conditions => {:method => :get}
... etc
end
end
Gives you:
asians_path
american_path(@person)
etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment