Forum: Ruby on Rails How to do routing ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1f7eb58e63aae3476bfd36409ad589bf?d=identicon&s=25 Nahalingam n. K. (nahalingam)
on 2006-06-14 14:01
(Received via mailing list)
Hi folks,

I am working in Fedora Core 2 Linux, and using Apache 2.0 and
mod_fastcgi,
as per mentioned in the following link, to support Rails.

http://wiki.rubyonrails.org/rails/pages/RailsOnFedora

I had created virtual host and specified the path to my application's
/var/www/html/myapp/public/ directory as a value for DocumentRoot
directives.

Now what is happening is that,
my index.html page is loading.

As per the example program development steps given in the tutorial
http://www.onlamp.com/lpt/a/5546
I had created database, tables, controllers, everything. but when i call
the
controller,
it could not be located properly. But the same application code is
running
properly with Webrick server within
the frame work.

Please help my dear folks, in this regards, by teach me how to call
controller.
and how to proceed further. I was stuck at this stage, being not having
helping hands near by.

Please help me with your valuable suggestions.

thanks in advance.
Chris Selmer (Guest)
on 2006-06-14 14:10
(Received via mailing list)
You'll have to remove the index.html page in order for your app to
work.  Rails works by acting as the default 404-file-not-found error
page, so when you make a request for the site root and there is an
index.html, rails isn't even called, and the index.html is served to
you.

In order for your site root to serve up a certain page, you'll also
need to edit the config/routes.rb file - check it out, there are
plenty of comments in there that will explain what to do.

Best of luck,
Chris
1f7eb58e63aae3476bfd36409ad589bf?d=identicon&s=25 Nahalingam n. K. (nahalingam)
on 2006-06-15 10:05
(Received via mailing list)
Hi,

First of all, I would like to convey my gratitude to our folks, who has
showed me the
path to proceed furthur. Really, this is the place where newbies like
myself
can get help.

Actually, as per your suggestions I have removed index.html from public/
directory.
Now it is apache's part to use .htaccess file to call appropirate
dispathcher,
but I think that my apache is not doing so.

In my .htaccess file, I have changed the dispatcher configuration to
call
fcgi files,
like the following,

RewriteRule ^(.*)$ /dispatch.fcgi?$1 [QSA,L]

and my file is also having the hander declarations, that is

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

The above three lines is also there in my .htaccess file.

And then, I am having a controller called as MyTest. so, I have modifed
my
routes.rb files
to call that controller through the following line of code

   map.connect '', :controller => 'MyTest', :action => 'index'

now also this configuration is not working with Apache.

But, this is working fine, and the controller is called properly, when I
am
using Webrick server.

Please help me with your valiable suggestions, in this regards.
This topic is locked and can not be replied to.