hi all, I’m very new to RoR and need some help over here.
from what i learnt from the tutorials, I understand that it’s very
easy to create, update, update, and delete data to and from the DB and
load everything to the ‘view’ rhtml pages. but now i’m confused when i
only want to load a normal home page that will not access any data
from the DB. must I create the active record as well?
any suggestion is appreciated.
Here is what you can do:
If you are trying to do this for your default home page you must do the
a) delete the index.html page in your public directory, go into your
routes.rb file and set up a route to the page you would like the default
page to be:
Here is what I did:
map.connect ‘’, :controller => “index”, :action=>“index”
What this means is for the default page redirect the request to the
index controller and look for the index method. You will have to set up
a index.rhtml page in the view directory called index.
If you are just trying to do this for any page:
set up a controller (call it whatever you would like). Inside your
controller create a method (call it whatever you would like also). Then
create a page in your view folder that matches the method name in your
controller that you created.
Hope this helps. If not, let me know.