Is this something that varies with the version of Rials,because I’m
having problems with it.
I have in config/routes.rb:
map.with_options(:controller => ‘wiki’) do |wiki|
wiki.web ‘:web’, :action => ‘view’,
:topic => ‘HomePage’,
:requirements => {
:web => %r{[A-Z][a-z]+}
}
wiki.web_topic ':web/:topic', :action => 'view',
:requirements => {
:web => %r{[A-Z][a-z]+},
:topic => %r{([A-Z][a-z])+{2,}}
}
# Everything else
wiki.connect '*url', :action => 'view_by_url'
end
Before I added the ‘requirements’ the following were caught correctly
/System
/System/CamelWord
After I added the ‘requirements’ everything ended up as ‘view_by_url’
I’ve simplified the patterns all the way down, but I think they are
right. I’ve tested at http://regexlib.com/
I’ve tried more “complicated” patterns: start of word/string markers,
explicit quantifiers, groupings, greedy and ungreedy. No avail.
I always end up with the ‘view_by_url’ catch-all.
I’m don’t see how “:format” is relevant. Could you expand on tat
please.
ptontiger said the following on 11/12/07 07:34 PM:
:month => nil
In a wiki, routes are handling
- Can I use that for something like
webtopic /:web.:topic {:controller=>“wiki”, :action=>“view”}
Obviously part of the constraint is that neither part can contain a period.
–
“It’s better to light a candle than to curse the darkness.”
- Eleanor Roosevelt