So now you have some basics put into your Web site, and you are ready to show some data to the public site. But you want to make the def index code in your controller use the show.html.erb.
1. Open pages_controller.rb
def index
@pages = Page.find(:all, :order => “page_order ASC”)
@page = Page.find(:first, :order => :page_order)
render :action=>’show’
end
This will force the use of show.html.erb when the public requests yourdomain.com/pages/
So in the query, it selects the first page in the Database. Because there is no ID sent from the path above, just /pages/ , so you gotta do this in the controller
The @pages query is for your navigation menu at the top, if you decide to make that part of your project dynamic. I’m pretty sure that I have the code somewhere in this blog to show how that works in the application view. look for listing of items in the titles for how to display that menu of page links.
