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
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
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
3 matches
Mail list logo