symlinks and controllers [stuck on welcome]

I've got a super basic quesion about getting rails up and running on a
host. I'm following this basic howto:

http://wiki.rubyonrails.com/rails/pages/HowtoUseSymLinksToGraftRailsOntoYourWebsite

in order to get a rails app up and running on my host, phpwebhosting
(oh the irony).

I've got my app sitting in /home/username/todo (todo is the app)

I've created my symlink to a www dir:

ln -s /home/username/todo/public /home/username/www/todo

everything is looking sharp at this point! I go to my site:

http://mydomain.com/todo/

I get the welcome aboard message, which is great. Create my
controllers and models and create an index method thinking that the
welcome message is going to get replaced with my index method.
However, the index doesn't come up and i'm stuck on the welcome
message! Instead, I have to go to this link to see my controllers
functioning.

http://mydomain.com/todo/todo

instead of

http://mydomain.com/todo/

now the docs say to use a rewrite for it, but there is also a comment
staying that its not needed and nor is it supported by the apache
folks. I don't have access to the httpd.conf, so i'm at a loss as to
what the next step might be.

thanks!
-l

Lincoln Mongillo wrote:

I've got a super basic quesion about getting rails up and running on a
host. I'm following this basic howto:

http://wiki.rubyonrails.com/rails/pages/HowtoUseSymLinksToGraftRailsOntoYourWebsite

in order to get a rails app up and running on my host, phpwebhosting
(oh the irony).

I've got my app sitting in /home/username/todo (todo is the app)

I've created my symlink to a www dir:

ln -s /home/username/todo/public /home/username/www/todo

everything is looking sharp at this point! I go to my site:

http://mydomain.com/todo/

I get the welcome aboard message, which is great. Create my
controllers and models and create an index method thinking that the
welcome message is going to get replaced with my index method.
However, the index doesn't come up and i'm stuck on the welcome
message! Instead, I have to go to this link to see my controllers
functioning.

http://mydomain.com/todo/todo

instead of

http://mydomain.com/todo/

now the docs say to use a rewrite for it, but there is also a comment
staying that its not needed and nor is it supported by the apache
folks. I don't have access to the httpd.conf, so i'm at a loss as to
what the next step might be.

thanks!
-l

If I remember correctly, you need to delete index.html in the public directory and also modify the default routing rule in config/routes.rb to do this.

If you look in routes.rb, it has something that should finally look like something like this:

  # You can have the root of your site routed by hooking up ''
  # -- just remember to delete public/index.html.
  map.connect '', :controller => "login", :action => "login"

That connection should route it, I think.

Cheers
Mohit.

Have you set the default route in config/routes.rb? To do simply,
look in the file and you'll see something like this:

  # You can have the root of your site routed by hooking up ''
  # -- just remember to delete public/index.html.
  # map.connect '', :controller => "welcome"

Change the map.connect line to something like this:

  map.connect '', :controller => "todo"

Where todo is the controller name; then go and delete the index.html
file from public/ and you should be good to go. :slight_smile:

--Jeremy