Skip to content

Loading…

Missing backslashes in route RegEx #39

Closed
jaredcwhite opened this Issue · 3 comments

2 participants

@jaredcwhite

This is the Rails 2.x version. I was having problems with my routes after installing the plugin, and finally I tracked it down to missing backslashes in the requirements for the route. The generator created this:

map.calendar '/calendar/:year/:month', :controller => 'calendar', :action => 'index', :requirements => {:year => /d{4}/, :month => /d{1,2}/}, :year => nil, :month => nil

But it really should be this:

map.calendar '/calendar/:year/:month', :controller => 'calendar', :action => 'index', :requirements => {:year => /\d{4}/, :month => /\d{1,2}/}, :year => nil, :month => nil

Hope that helps! --Jared

@jeffschuil
Elevation member

Fix the route that's generated for Rails 2. Closed by 50389f7.

@jaredcwhite

Awesome! Glad to see it get updated so quickly!

@jeffschuil
Elevation member

Yeah, it was a good catch. I'm kinda surprised someone hadn't brought this up sooner. Thanks for the help.

@nickhammond nickhammond pushed a commit to nickhammond/event_calendar that referenced this issue
@jeffschuil jeffschuil Fix the route that's generated for Rails 2. Closes #39. 50389f7
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.