Created
September 18, 2011 22:34
-
-
Save Nakort/1225646 to your computer and use it in GitHub Desktop.
Writing code that generates code
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
[:saved_checkins, :invalid_checkins].each do |name| | |
controller name do | |
scope :path => name do | |
match "/", :action => "index", :as => name | |
match "/:id", :action => "destroy", :as => name.to_s.singularize, :via => :delete | |
match "/:id", :action => "create", :as => name.to_s.singularize, :via => :post | |
match "/:id", :action => "show", :as => name.to_s.singularize, :via => :get | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment