Note that there are some explanatory texts on larger screens.

plurals
  1. POStill having a hard time with RoR MVC approach
    text
    copied!<p>I suppose it should do justice to state what I think I know so far as well as what I've done:</p> <p>1) I created the app and did my first db migration; I know have my dev, test and production databases. The dev db has a table called 'wines'.</p> <p>2) I made a scaffold which created the necessary files.</p> <p>3) The basic index/update/destroy methods are set up and I can browse the pages.</p> <p>4) From what I gather, the ActiveRecord class "Wine" automatically inherits properties from the database? Each column is a property and each row in the table 'wines' is a potentially instantiated object which is called from the wine_controller script.</p> <p>The problem I'm having now is that I want to create a common layout that all controllers use. The only things that will change will be the page title, potentially some &lt;link&gt; tags in the header, the &lt;body&gt; attributes (javascript onload events most likely) and whatever lies inside the &lt;body&gt; tag.</p> <p>I find myself looking up functions that will do what I want (like "favicon_link_tag", "stylesheet_link_tag" and "auto_discovery_link_tag"...) but I can't find the right place to PUT them! I know this has something to do with my lack of understanding of how things are executed/inherited. For example if I were to declare @pageTitle in application_controller.rb and use @pageTitle in ApplicationHelper it won't work. Or even using "stylesheet_link_tag" in application_controller.rb throws an error. I'm just not getting something.</p> <p>How does each thing relate to another in terms of chronological execution, scope, etc.?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload