I have a rails model Company and want to have pretty urls on it instead of the default id (for seo and security reasons). For most of the cases it works. I've noticed on Company names ending with a period, I receive an error like the one below:
No route matches [GET] "/admin/companies/Baking%20co."
To test this out, I removed the friendly_id implementation and simply overrided the to_param method
def to_param
name
end
And changed the controller show action from
Company.find(params[:id])
to
Company.find_by_name(params[:id])
This has the same effect as the friendly_id method. I get most of the companies showing up but I still receive the same error on names ending with period.