# Strano comportamento delle routes

**URL:** <https://www.ruby-forum.com/t/strano-comportamento-delle-routes/173429>\
**Category:** IT\
**Created:** [August 8, 2009, 3:23pm UTC](https://www.ruby-forum.com/t/strano-comportamento-delle-routes/173429 "2009-08-08T15:23:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alesc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@alesc](https://www.ruby-forum.com/u/alesc)\
**Post date:** [August 8, 2009, 3:23pm UTC](https://www.ruby-forum.com/t/strano-comportamento-delle-routes/173429/1 "2009-08-08T15:23:16Z")

</div>

oggi ne ho trovata un altra 🙂

ho un file in  
public/gallery/Company/1/attachments/Fattura\_Proforma\_30\_07\_2009.pdf

se punto il browser ottengo 2 cose:

1. download del file (comportamento corretto)
2. 

ActionController::RoutingError (No route matches  
“/gallery/Company/1/attachments/Fattura\_Proforma\_30\_07\_2009.pdf” with  
{:method=\>:get}):

Rendering /var/www/clerk/public/404.html (404 Not Found)

come elimino la seconda (non vedo la ragione di mettere una route per un  
contenuto statico)?

---

<div class="post-metadata">

**Author:** ![alesc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@alesc](https://www.ruby-forum.com/u/alesc)\
**Post date:** [August 11, 2009, 3:11pm UTC](https://www.ruby-forum.com/t/strano-comportamento-delle-routes/173429/2 "2009-08-11T15:11:07Z")

</div>

Alessandro S. wrote:

> oggi ne ho trovata un altra 🙂
> 
> ho un file in  
> public/gallery/Company/1/attachments/Fattura\_Proforma\_30\_07\_2009.pdf
> 
> se punto il browser ottengo 2 cose:
> 
> 1. download del file (comportamento corretto)
> 2. 
> 
> ActionController::RoutingError (No route matches  
> “/gallery/Company/1/attachments/Fattura\_Proforma\_30\_07\_2009.pdf” with  
> {:method=\>:get}):
> 
> Rendering /var/www/clerk/public/404.html (404 Not Found)
> 
> come elimino la seconda (non vedo la ragione di mettere una route per un  
> contenuto statico)?

Non ti preoccupare, di solito si scopre sempre qualcosa con questi tuoi  
bug .-)  
rake routes che dice? Hai qualcosa per /gallery?

Tuttavia Ã¨ abbastanza strano che il file arrivi e ci sia anche il  
routing error (Ã¨ solo nel log o anche a schermo?). Se non ricordo male  
hai un apache davanti a clerk. Mi viene quasi da pensare che il file sia  
servito da apache ma che Apache faccia poi una richiesta anche a Rails  
per cui guarderei anche i log e la configurazione del web server.

Paolo
