Skip to content

Periods in your rails requests and the “format”

by Topper on October 26th, 2011

I sometimes hit a bug where a username has a period in it… so if you have a path such as:

/users/my.username/files/file.ext

Rails will parse that first period as the beginning of the format param… so you lose the files route, etc.

It does let you use %2E though which will be unescaped to the period in your params… so

/users/my%2Eusername/files/file.ext

will give you the correct user_id param of “my.username” and continue on its routed merry way.

Just a simple reminder. Probably more for me than you 🙂

From → Social Web