On 6/28/06, Francois Beausoleil <[EMAIL PROTECTED]> wrote:
Hi all,
The route is:
map.game_instructions 'game/:game/instructions', :controller => 'games',
:action ="" 'instructions', :requirements => {:game => /\A[-\w \+%]+\Z/i}
Placing ^, \A, \Z, and $ inside regexp captures for requirements is not required, and should not be allowed.
When you say :game => /[a-z]+/ routes should interpret this as \A[a-z]+\Z when matching against a single value.
Keep in mind that the supplied regexp must work inside of a single regexp for the whole path. So using any of the aforementioned controls will obviously cause this to fail.
If you come across a case where removing your control characters causes regexps to match input it should not, please let me know.
Perhaps we should add an informative error message for this case. Feel free to weight in if you think so. (Or better yet, send a diff + unit test.)
Thanks,
Nicholas Seckar
_______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core