<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ian Matthews on Medium]]></title>
        <description><![CDATA[Stories by Ian Matthews on Medium]]></description>
        <link>https://medium.com/@imatthews009?source=rss-112693b72d7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*YlLmZBBZOB9ukZwT.</url>
            <title>Stories by Ian Matthews on Medium</title>
            <link>https://medium.com/@imatthews009?source=rss-112693b72d7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 05:30:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@imatthews009/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Basics of Active Record Associations]]></title>
            <link>https://medium.com/@imatthews009/the-basics-of-active-record-associations-8759bf526e79?source=rss-112693b72d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/8759bf526e79</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Ian Matthews]]></dc:creator>
            <pubDate>Mon, 18 Sep 2017 17:47:57 GMT</pubDate>
            <atom:updated>2017-09-18T17:47:57.346Z</atom:updated>
            <content:encoded><![CDATA[<p>I was recently designing a simple online store app in Ruby on Rails and ran into the problem of having to link my Order model to my Product model. I wanted my orders to hold multiple products but I did not know how to link my models. The solution was to use simple active record associations.</p><h3><strong>belongs_to vs. has_many</strong></h3><p>The first step in linking active record models is to figure out which model “has many” and which “belongs to”. In this case, a product can be ordered many times. I would assign the <strong><em>belongs_to</em></strong> association to the Order model and the <strong><em>has_many</em></strong> to the Product Model.</p><p>To create the association I would add the following lines of code to the Order model and the Product model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/239/1*vvysRPwWo6gFNg2ILT4yxA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*akIbV4OwpWGcSuyoOSPM6Q.png" /></figure><p>You’ll notice that product is singular and orders is plural. This is important to follow when using <em>belongs_to</em> and <em>has_many</em>.</p><h3><strong>Foreign Key</strong></h3><p>Now that I have set the associations I can add a foreign key. This key is what links items within the two tables. The key needs to be added to the table that <em>has many </em>instances of the other. Since individual products can be included within many order I will add <strong>order_id</strong> to my product table through a new migration<em>.</em></p><p>Now you can call these associations when working on your project!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8759bf526e79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install Bootstrap v4]]></title>
            <link>https://medium.com/@imatthews009/how-to-install-bootstrap-v4-37b6b6f49821?source=rss-112693b72d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/37b6b6f49821</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Ian Matthews]]></dc:creator>
            <pubDate>Fri, 15 Sep 2017 17:28:42 GMT</pubDate>
            <atom:updated>2017-09-15T17:28:42.728Z</atom:updated>
            <content:encoded><![CDATA[<p>Bootstrap is a html, css, and javascript framework that helps you design stylish websites. The framework is a front-end library that is easily customizable and drastically cuts down the time needed to make a website that fits all your needs.</p><p><strong>Install Bootstrap v4.</strong></p><p>You can install bootstrap through their website at <a href="https://v4-alpha.getbootstrap.com/getting-started/download/">https://v4-alpha.getbootstrap.com/getting-started/download/</a>. If you need further instruction you can watch Brad Hussey’s video below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FOU8wX88mulk%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DOU8wX88mulk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FOU8wX88mulk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/aea81093e84f0e9ce2bd6b8e6b5b95d2/href">https://medium.com/media/aea81093e84f0e9ce2bd6b8e6b5b95d2/href</a></iframe><p><strong>Add Bootstrap to your rails Gemfile.</strong></p><p>Locate your Gemfile in your project and add the following lines:</p><pre>gem ‘bootstrap’, ‘~&gt; 4.0.0.beta’</pre><pre>gem ‘jquery-rails’</pre><p>Now in your terminal install the newly added gems by typing:</p><pre>bundle install</pre><p>Within <strong>app/assets/stylesheets</strong> create a new file called <strong>_external.css.scss </strong>and add the following line:</p><pre>@import “bootstrap”;</pre><p>Inside your <strong>app/assets/javascripts/application.js </strong>add these lines:</p><pre>//= require jquery3</pre><pre>//=require popper</pre><pre>//=require bootsrap-sprockets</pre><p>Now that you have Bootstrap installed you can begin designing your website using bootstrap.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37b6b6f49821" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to link your Git Repository to your working folder]]></title>
            <link>https://medium.com/@imatthews009/how-to-link-your-git-repository-to-your-working-folder-4c925b15d0a1?source=rss-112693b72d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c925b15d0a1</guid>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Ian Matthews]]></dc:creator>
            <pubDate>Wed, 30 Aug 2017 20:21:14 GMT</pubDate>
            <atom:updated>2017-08-30T21:30:54.067Z</atom:updated>
            <content:encoded><![CDATA[<p>A git repository stores and tracks changes in a project on GitHub. You can setup a repository to manage your project by doing the following:</p><ol><li>Create a new folder for your project. You can do this through the terminal by using the mkdir project_name command. Then go to that folder in your terminal by using the cd command.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*30LQ7E-lfnV28UKTKDu3nw.png" /></figure><p>2. Now you can create your git repository within your new project folder by typing in git init. You will get a message that you created an empty repository and, depending how you have your terminal setup, you will have new text showing whether your git repository is up to date. After the repository is created, a green checkmark will appear that indicates there is nothing that needs to be pushed to Github. After you add a new file to your folder, the check mark changes to a red x and you can see a ?:1. This new line indicates you have 1 new change that can be pushed to Github.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*MmIOYJp9AdWZVdx05zJV_Q.png" /></figure><p>3. Add the changes made by typing (git add .). This adds all changes. Then commit the changes by typing (git commit -m “a message describing your changes”). Now you’ll notice the red x changed back to a green arrow. This means the changes have been committed and are ready to be pushed to Github.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*iyx8WkGBEXMRLryqQDtETg.png" /></figure><p>4. Create a Repository in github.com. You can do so by going to your account and hitting New repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UcTHDOT3mHSydnonJ7jarg.png" /></figure><p>5. The repository name should be the name of the folder you created in step 1. In this case I named it example_project. Then hit create repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*2WbxHeE5byP2FOZhSb3o2Q.png" /></figure><p>6. Add the lines of code found in the (…or push an existing repository from the command line) to the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*3MA3F1E0Zj_IOmi6WOaKIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*z94huFdH5SoRP9zmxdSNqA.png" /></figure><p>7. That’s it! Now all you need to do is commit and push changes to Github as you work on your project. Just follow the steps from before by using the following commands: git add ., git commit -m “description”, git push origin master.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c925b15d0a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>