Created
January 9, 2014 10:40
-
-
Save wenoki/8332298 to your computer and use it in GitHub Desktop.
Railsで半静的なページを量産したい時のroutes。pages_controller.rbにdef foo; endするだけでfoo_pathで/fooを参照できるようになる。
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
PagesController.action_methods.each do |action| | |
match action, | |
action: action, | |
controller: :pages, | |
via: :get, | |
as: action | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment