Jim Neath

Manchester based Ruby on Rails & Facebook App Developer

Escaping Params Containing Periods

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.

blog comments powered by Disqus

I am available for freelance work! Click here to email me.

Jim Neath is a Freelance Ruby on Rails & Facebook app developer from Manchester, UK, currently working for Engine Yard.