Re: [Rails] A truly default route

2018-02-23 Thread Walter Lee Davis
Sure. This is from a CMS where pages can be accessed by their "slug" parameter. So a link to www.example.com/some-unique-name will resolve to PagesController#show with the :slug parameter populated with the value 'some-uniqe-name'. I also added the constraints bit (optional if you really just m

Re: [Rails] A truly default route

2018-02-22 Thread Ralph Shnelvar
Title: Re: [Rails] A truly default route Walter, This is WAAAY above my head. Would you please give an explanation?  Are both lines necessary? Ralph Thursday, February 22, 2018, 7:05:30 PM, you wrote: WLD> Here's the bottom of one of my routes.rb files: WLD>   # this has to

Re: [Rails] A truly default route

2018-02-22 Thread Walter Lee Davis
Here's the bottom of one of my routes.rb files: # this has to be the last option in order to work with unprefixed routes get '/:slug', to: 'pages#show', constraints: lambda { |request| Page.pages.include? request.path_parameters[:slug] } get "*any", via: :all, to: "errors#not_found" Tha