# Map.resources routing question

**URL:** <https://www.ruby-forum.com/t/map-resources-routing-question/121916>\
**Category:** Rails\
**Created:** [December 2, 2007, 9:41pm UTC](https://www.ruby-forum.com/t/map-resources-routing-question/121916 "2007-12-02T21:41:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RSElliott\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b487fb/32.png) [@RSElliott\_M](https://www.ruby-forum.com/u/RSElliott_M)\
**Post date:** [December 2, 2007, 9:41pm UTC](https://www.ruby-forum.com/t/map-resources-routing-question/121916/1 "2007-12-02T21:41:42Z")

</div>

I am just learning RESTful design and trying to redesign my application  
to follow the paradigm, but I am still confused about how to tackle  
certain things.

I have a model called Upload and naturally a controller called  
UploadsController. Its show action simply uses the send\_file method to  
display an image to the user, but sends the file with a filename  
different from that which is on the fileserver (this is so all uploaded  
files can have random filenames on the server yet be sent to users with  
their original filename).

So /uploads/real\_filename.jpg/fake\_filename.jpg would be the URL.  
Unfortunately I am having trouble making this work with the upload\_path  
method as it is, since it only takes :id and I need to specify two  
params, the original filename and the replacement filename. When I try  
to make my own named route, map.upload, then it ruins the upload\_path  
method for PUT and DELETE.

I even tried to just send “real\_filename.jpg/fake\_filename.jpg” as the  
id for upload\_path and then user the action to split the :id along the  
forward slash, but unfortunately Rails turns that “/” into the entity  
“%2F” in the URL, which looks wrong in the browser address bar.

Am I misusing my UploadsController’s show method? It seemed  
appropriate, but being less anal about the whole deal I could use either  
a different method or a different named route for what I’m trying to  
achieve. Even still I’m curious as to know if what I’m trying to  
achieve is even practical and how it could be done.
