# How to start a application from a controller

**URL:** <https://www.ruby-forum.com/t/how-to-start-a-application-from-a-controller/76871>\
**Category:** Rails\
**Created:** [November 21, 2006, 9:55pm UTC](https://www.ruby-forum.com/t/how-to-start-a-application-from-a-controller/76871 "2006-11-21T21:55:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vnac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f4b2a3/32.png) [@vnac](https://www.ruby-forum.com/u/vnac)\
**Post date:** [November 21, 2006, 9:55pm UTC](https://www.ruby-forum.com/t/how-to-start-a-application-from-a-controller/76871/1 "2006-11-21T21:55:16Z")

</div>

I am new to ROR. I want to start my application from the controller  
instead of /public/index. Is it possible?

---

<div class="post-metadata">

**Author:** ![vnac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f4b2a3/32.png) [@vnac](https://www.ruby-forum.com/u/vnac)\
**Post date:** [November 21, 2006, 11:44pm UTC](https://www.ruby-forum.com/t/how-to-start-a-application-from-a-controller/76871/2 "2006-11-21T23:44:29Z")

</div>

Varsha Nachane wrote:

> I am new to ROR. I want to start my application from the controller  
> instead of /public/index. Is it possible?

What do you “start application from the controller”?

Do you want the root of you publicly accessible file to not be in the  
public directory?

If so, this is a very bad idea. It will be too easy to download your  
source code, or worse, your database password.

---

<div class="post-metadata">

**Author:** ![vnac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f4b2a3/32.png) [@vnac](https://www.ruby-forum.com/u/vnac)\
**Post date:** [November 22, 2006, 4:45am UTC](https://www.ruby-forum.com/t/how-to-start-a-application-from-a-controller/76871/3 "2006-11-22T04:45:51Z")

</div>

Hi, if you mean you want to go to

[http://example.com/](http://example.com/)

_instead of_

[http://example.com/index](http://example.com/index)

then you need to edit config/routes.rb. Set this line to the  
controller you want:

map.connect ‘’, :controller =\> “go”

Hope that helps.

- James

---

<div class="post-metadata">

**Author:** ![vnac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f4b2a3/32.png) [@vnac](https://www.ruby-forum.com/u/vnac)\
**Post date:** [November 22, 2006, 9:54pm UTC](https://www.ruby-forum.com/t/how-to-start-a-application-from-a-controller/76871/4 "2006-11-22T21:54:09Z")

</div>

Thank You! I did set up in routes.rb and it worked!  
Alex, is there any way I can protect downloading my source code (or even  
view HTML source on browser) because I don’t have any content on my  
index page.

---

<div class="post-metadata">

**Author:** ![vnac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f4b2a3/32.png) [@vnac](https://www.ruby-forum.com/u/vnac)\
**Post date:** [November 22, 2006, 10:21pm UTC](https://www.ruby-forum.com/t/how-to-start-a-application-from-a-controller/76871/5 "2006-11-22T22:21:54Z")

</div>

Thank You!

---

<div class="post-metadata">

**Author:** ![vnac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f4b2a3/32.png) [@vnac](https://www.ruby-forum.com/u/vnac)\
**Post date:** [November 22, 2006, 10:07pm UTC](https://www.ruby-forum.com/t/how-to-start-a-application-from-a-controller/76871/6 "2006-11-22T22:07:52Z")

</div>

Varsha Nachane wrote:

> Alex, is there any way I can protect downloading my source code (or even  
> view HTML source on browser) because I don’t have any content on my  
> index page.

That is a FAQ on HTML forums. There’s no way to hide your HTML from the  
user, because once you send it over the wire, they own it, and they need  
it  
to be secure.

Your Ruby is naturally invisible!

–  
Phlip  
[Redirecting...](http://www.greencheese.us/ZeekLand) ← NOT a blog!!!
