I've just started using ruby on rails, and I'd like for a first try create a simple website.
But I can't figure out how to organise it from the RoR point of view.
Here is my problem:
I'd like to set up a website with a two level menu, so there will be different groups of menu elements.
Do I have to create one controller for each group? Each page would be then represented by one method.
You don't have to, but it might be easier...
In that case then, how can I do to have one common layout for all the controllers?
app/controllers/application.rb: class ApplicationController < ActionController::Base layout 'default' end
app/controllers/about_controller.rb class AboutController < ApplicationController def index end
def contact end
.... end
app/controllers/product_controller.rb class ProductController < ApplicationController def index end
def product end
.... end
app/views/layouts/default.rhtml: <html> my default view... <%= yield "layout" %> ... </html>