Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Markech
refinerycms-news
Commits
a54d3840
Commit
a54d3840
authored
Nov 13, 2012
by
Uģis Ozols
Browse files
Merge pull request #119 from allspiritseve/2-0-stable
Specify regex for year and month within archive route
parents
401d3ecb
09fb5c78
Changes
1
Hide whitespace changes
Inline
Side-by-side
config/routes.rb
View file @
a54d3840
Refinery
::
Core
::
Engine
.
routes
.
draw
do
namespace
:news
do
root
:to
=>
"items#index"
get
'archive/:year(/:month)'
,
:to
=>
'items#archive'
,
:as
=>
'items_archive'
get
'archive/:year(/:month)'
,
:to
=>
'items#archive'
,
:as
=>
'items_archive'
,
:constraints
=>
{
:year
=>
/\d{4}/
,
:month
=>
/\d{1,2}/
}
resources
:items
,
:only
=>
[
:show
,
:index
],
:path
=>
''
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment