Deserialize URLs to resources in Rails