Skip to content

Instantly share code, notes, and snippets.

@wenoki
Created January 9, 2014 10:40
Show Gist options
  • Save wenoki/8332298 to your computer and use it in GitHub Desktop.
Save wenoki/8332298 to your computer and use it in GitHub Desktop.
Railsで半静的なページを量産したい時のroutes。pages_controller.rbにdef foo; endするだけでfoo_pathで/fooを参照できるようになる。
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