Re: Routes - Preventing a Match

Colin Law
Sat, 06 Jun 2009 12:31:16 -0000

2009/6/6 djolley
<ddjolley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>
>> If you are wanting Rails to stop processing, what should it do?
>> What are you really wanting to achieve?
>
> I just want the URL to be served-up as a static page.
>
>> The normal use case is that static files are not served by Rails but
>> in that circumstance, another server would serve them *before* Rails.
>
> I don''t understand that.  As configured out-of-the-box Rails
serves
> the static page public/index.html as a home page.  Although I have
> never done it, I assume that I could simply modify that static page
> and use it as the home page for a site.  I just want to accomplish
> essentially the same thing.  I want to be able to have a few
> static .html pages in public/static, e.g. public/static/test1.html.
> In the case of this example, I don''t want
''static'' to map to a
> controller and ''test1'' map to an action.  It would be my
understanding
> that that is what would happen if there were some sort of beginning
> instruction in the routes.rb file to the effect that if a URL begins
> with /static there should be no further processing thus the standard
> mappings to a controller and an action would just not be invoked WRT
> that particular URL.

I think the point is that requests for the static pages never get as
far as routes.rb.  They are handled before the processing gets to this
file so there is nothing that can be done in routes.rb to affect how
they are handled.

Colin

>
> Anyway, I didn''t mean to get carried away here.  I believed that I
was
> just missing some minor point and that someone would square me away
> with ease.  Apparently the point isn''t as trivial as I had
thought.
>
> Thanks for the input.
>
>          ... doug
>
> >
>