# Static route

**URL:** <https://www.ruby-forum.com/t/static-route/135108>\
**Category:** Rails\
**Created:** [April 17, 2008, 10:31pm UTC](https://www.ruby-forum.com/t/static-route/135108 "2008-04-17T22:31:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [April 17, 2008, 10:31pm UTC](https://www.ruby-forum.com/t/static-route/135108/1 "2008-04-17T22:31:35Z")

</div>

It would seem a simple thing to do but I’m not finding it…

all I want to do is to serve my ‘doc/app/index.html’ API within my Rails  
application.

I can’t figure out what to add to routes.rb to allow this to happen.

Someone toss me a bone please

Craig

\<%= link\_to ‘Software API’, ‘[http://localhost/../doc/app/index.html](http://localhost/../doc/app/index.html)’,  
{:target =\> “\_new”} %\>

Routing Error  
no route found to match “/doc/app/index.html” with {:method=\>:get}

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [April 18, 2008, 12:21am UTC](https://www.ruby-forum.com/t/static-route/135108/2 "2008-04-18T00:21:45Z")

</div>

You could just do:

map.connect “doc/app”, :controller =\> ‘[insert whatever controller  
you’re serving this from]’, :action =\> ‘index’

And then

\<%= link\_to ‘Software API’, ‘[http://localhost/../doc/app/](http://localhost/../doc/app/)’, {:target  
=\> “\_new”} %\>

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [April 18, 2008, 12:23am UTC](https://www.ruby-forum.com/t/static-route/135108/3 "2008-04-18T00:23:31Z")

</div>

in code, this:

\<%= link\_to ‘Here’, ‘[ESPN.com](http://espn.go.com/index.html)’, :target =\> ‘\_new’  
%\>

renders this:

[Here](http://espn.go.com/index.html)

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [April 18, 2008, 12:49am UTC](https://www.ruby-forum.com/t/static-route/135108/4 "2008-04-18T00:49:15Z")

</div>

that doesn’t work at all…perhaps it’s just me but

routes.rb, I inserted…  
map.connect ‘doc/app/index.html’,  
:controller =\> ‘help’,  
:action =\> ‘index’

and when I try to go to [http://localhost/doc/app/index.html](http://localhost/doc/app/index.html)  
I get this error…

Unknown action  
No action responded to index

which makes sense because I commented out the ‘index’ method in help  
controller but I just want to route a single, static page, no method,  
not controller.

Craig

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [April 18, 2008, 12:39am UTC](https://www.ruby-forum.com/t/static-route/135108/5 "2008-04-18T00:39:54Z")

</div>

Sorry. You can actually do:

map.connect “doc/app/index.html”, :controller =\> ‘[insert whatever  
controller you’re serving this from]’, :action =\> ‘index’

If you want to include the actual html page in there…

On Apr 17, 3:20 pm, “removed\_email\_address@domain.invalid” \<ESPN3.DL-
