Adding the root index page?

hi all (newbie here)

what is the best way to create a dynamic root to your ROR application,
i.e. to the address: http://localhost:3000. By default this is created
in the public folder as a html page.

I was wondering whether I should delete this page and create a new one
in the app, and if this is the case how do i configure the controller
and view to display this page?

Hi, you can easily edit the index.html located in your RoR app’s public
folder.

Good luck,

-Conrad

Just add an index action on whatever controller you’re using to serve up
whatever. [Specific, huh?] Add a route like so…

map.index “/”, :controller => [your controller], :action => “index”

It’s that simple. If it doesn’t fit in neatly with any of your other
controllers, you might want to just plop that index method into
ApplicationController. Just make sure the routing directs the base path
to
the right controller and method. No need to rely on a static page.

RSL

Russell N. wrote:

RSL
Yes, just edit config/routes.rb and it’s written right there in the
comments.


Chris M.
Web D.
http://chriscodes.com

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