How to start a application from a controller

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

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.

Hi, if you mean you want to go to

http://example.com/

instead of

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

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.

Thank You!

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
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs