Escaping Params Containing Periods

November 22nd, 2008

Just a quick one. Say you have a route like the following:

map.resources :users

And you’re using email addresses to look up users like:

/users/jim@somewhere.com

You’re going to run into an error along the lines of:

Missing template users/show.com.erb in view path blah/app/views

Which obviously isn’t what you want. To fix this, change your route to the following:

map.resources :users, :requirements => { :id => /.*/ }

Rejoice.

(Possibly) Related Posts

Recommend Me

If you found this post or anything else on this site of any use, then please take the time to recommend me on Working with Rails.

You can follow any responses to this entry through the RSS 2.0 feed. Trackback from your own site.

One Response to “Escaping Params Containing Periods”

  1. March 26th, 2009 at 2:21 pm - Escaping Params Containing Periods « A little story Says:

    [...] March 26, 2009 Source: http://jimneath.org/2008/11/22/escaping-params-containing-periods/ [...]


Leave a Reply

You must be logged in to post a comment.

Jim Neath is a 24 year old Ruby on Rails developer from Manchester, UK. Contact Jim Neath

    follow me on Twitter
    Recommend Me

    Categories

    Stalk Me