Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/static_stuff/routes.rb

Instance Method Summary collapse

Instance Method Details

#static_pages(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/static_stuff/routes.rb', line 3

def static_pages(options = {})
  namespace :static_stuff, path: '/', as: '' do
    options.reverse_merge!(
      to: 'pages#show',
      as: :pages,
      constraints: { page: /[[[:alnum:]]\-_\/]+/ }
    )

    get ':page', options
  end
end