I'm new to Ruby on Rails and I'm sure this question is pretty stupid, but I can't deduce the answer from the examples I've seen, perhaps I haven't seen many good ones.
A website I am working on will have 'boxes' (i.e. widgets) in one side bar that will contain dynamic content, and it will also have links on the other sidebar to sections of the website that will be handled by different controllers. The layout/style of the website will remain the same throughout the controllers. For example, if I click on one link, the content in the center will change but the rest of the site's design and layout will remain the same.
My question is if I should create something like a home
controller which will handle the front page and the site's layout, and then somehow yield to a specific controller's layout should it be invoked, then specify that controller as the root controller in routes.rb
? I am simply wondering how I would go about specifying that the layout should remain relatively the same, so that I don't have to be redundant and paste the same layout code for each controller. This is what someone on IRC recommended, to create a home
controller, but I wanted to know if this was the normal way of doing things. The answer could actually be really simple for all I care, but since I'm new to rails, I'm oblivious.
I don't really know how to word my question properly since I'm relatively new to rails. If something does not make sense please let me know and I will try to clarify.
Thanks.