<?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 John Messina on Medium]]></title>
        <description><![CDATA[Stories by John Messina on Medium]]></description>
        <link>https://medium.com/@johnmessina_10236?source=rss-b4a863e1b504------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*lNq3STSZzbiXjU0H.</url>
            <title>Stories by John Messina on Medium</title>
            <link>https://medium.com/@johnmessina_10236?source=rss-b4a863e1b504------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 01:45:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnmessina_10236/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[Deploying Your App on Heroku]]></title>
            <link>https://medium.com/@johnmessina_10236/deploying-your-app-on-heroku-ab6e2e74c2d4?source=rss-b4a863e1b504------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab6e2e74c2d4</guid>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[rails]]></category>
            <dc:creator><![CDATA[John Messina]]></dc:creator>
            <pubDate>Fri, 26 May 2017 19:31:05 GMT</pubDate>
            <atom:updated>2017-05-26T19:34:57.984Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi all! It has been a little while since my last post. A lot has been going on and it has been a whirlwind couple of months! I graduated from the Actualize bootcamp and have started an apprenticeship at The Difference Engine. My final Capstone project/presentation was a success and I am very happy with the final result, although I still consider it a work in progress (I want to add more improvements/features over time). I have deployed my app to Heroku, so it is online for the world to see. Here is the link: <a href="https://travel-buddy.herokuapp.com/">https://travel-buddy.herokuapp.com</a>/.</p><p>Having accomplished this task, I thought I would write a post about my procedure for deploying to Heroku. This may be helpful to anyone looking to do the same. Please note that this procedure assumes your app is using a postgres database. So, here goes:</p><p>First thing you need to do is sign up with Heroku: <a href="https://www.heroku.com./">https://www.heroku.com.</a> Then you need to download the Heroku CLI (Command Line Interface). Go to the following link and download the appropriate file for your system: <a href="https://devcenter.heroku.com/articles/getting-started-with-ruby#set-up">https://devcenter.heroku.com/articles/getting-started-with-ruby#set-up</a>. Next, run in your terminal:</p><pre>$ heroku login </pre><p>If you’re using an older version of Rails (earlier than version 5), add the following to your Gemfile:</p><pre>gem &#39;rails_12factor&#39;, group: :production</pre><p>And run in your terminal:</p><pre>$ bundle install</pre><p>Then make sure the latest version of your app is pushed up to GitHub:</p><pre>$ git add --all<br>$ git commit -m &#39;commit message&#39;<br>$ git push origin master</pre><p>Then run the following command ONLY ONCE PER APP:</p><pre>$ heroku create</pre><p>Next, push the app to Heroku:</p><pre>$ git push heroku master</pre><p>You may get at authentication failure at this point. If this happens, run the following command and then try the previous step again:</p><pre>$ heroku keys:add</pre><p>Now you must migrate your database to Heroku:</p><pre>$ heroku run rake db:migrate</pre><p>Now open your website and enjoy seeing your app live:</p><pre>$ heroku open</pre><p>One snag I hit when deploying to Heroku was figuring out how to configure things such as access keys for API’s/cloud storage. I had them stored privately in my app, but Heroku wasn’t getting access to them. I figured out that I had to run the “heroku config:set” command to configure this data. For example:</p><pre>$ heroku config:set AWS_ACCESS_KEY_ID=your_access_key_id</pre><p>You can read more about Heroku config variables here: <a href="https://devcenter.heroku.com/articles/config-vars">https://devcenter.heroku.com/articles/config-vars</a></p><p>So, that about covers it. Good luck deploying your app! :-)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab6e2e74c2d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitHub and a Team Project]]></title>
            <link>https://medium.com/@johnmessina_10236/github-and-a-team-project-5581d9f3643e?source=rss-b4a863e1b504------2</link>
            <guid isPermaLink="false">https://medium.com/p/5581d9f3643e</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[John Messina]]></dc:creator>
            <pubDate>Wed, 15 Mar 2017 00:45:18 GMT</pubDate>
            <atom:updated>2017-03-15T00:45:18.820Z</atom:updated>
            <content:encoded><![CDATA[<p>I am going to switch gears a bit with this next blog post. Instead of discussing writing code, I am going to talk about using GitHub when working on a team project. My class recently had an assignment where we were split up into teams. Each team had the task of implementing a feature of a bigger project. Within each team, the members had to collaborate to complete their specific part. In addition, the teams had to communicate with each other in order to have the different components of the project work together properly. This is indicative of how things would work in the real world and I found this to be an extremely important learning experience. With our specific assignment, team 1 had to create an API containing student resume data, team 2 had to create a student portal where a student could view and edit that data and team 3 had to use that data to display a good looking resume that could be viewed publicly.</p><p>When working in a team on a specific feature, first you must have a master branch with contains the initial basic app. One member of the team would create this master branch by pushing the app into a repository on GitHub using the following command in the terminal (make sure you are in your app folder):</p><pre>$ git push origin master</pre><p>Once this is done, the creator of the master branch can add collaborators (the other team members) which will enable them to contribute to the app. To accomplish this, navigate into the proper repository on GitHub and click on the “settings” link on the upper right. On the next page, click on “Collaborators” on the menu on the left (you may be asked to reenter your password after doing this). Here you can search for other users. When you find the appropriate user, click the “Add collaborator” button. Now that person can contribute to the app.</p><p>Each member of the team can now work individually on a certain feature of the app. When working on a feature, it is important to ensure that you are working with the most recent version of the “master” program. You do this by running the following command in the terminal:</p><pre>$ git pull origin master</pre><p>Next you must create a separate branch where you can work on your specific feature. To create a feature branch, enter the following command:</p><pre>$ git checkout -b feature-branch-name</pre><p>The “feature-branch-name” should describe the feature on which you’re working. Now you will be doing your work on your feature branch. It is important to work on this branch rather than the master branch to ensure that you don’t push any faulty or conflicting code into the master app. For each chunk of code that you complete, you should add and commit your work with the following commands:</p><pre>$ git add --all<br>$ git commit -m &#39;commit message&#39;</pre><p>When you want to push all the code you’ve written to GitHub, you must first merge any changes from the master branch with the feature branch on which you are currently working. Again, run the following command:</p><pre>$ git pull origin master</pre><p>You will be alerted if there are any merge conflicts. If there are conflicts, go into the app and fix the code that is causing the problem(s) and then do another add and commit. Now you are ready to push your feature branch up to GitHub. To do this, run the following command:</p><pre>$ git push origin feature-branch-name</pre><p>Next, you must make a pull request on your branch on GitHub by clicking the appropriate buttons. This is a request to merge your branch with the master branch. GitHub will notify you if there are any merge conflicts. If there are no conflicts, another team member can review your work as a double check and then approve and merge your changes into the master branch. Once this is successfully completed, your feature branch can be deleted from GitHub using the “Delete branch” button. The feature branch can now also be deleted locally on your computer. You cannot delete a branch you are currently in, so first you must navigate out of your feature branch using the following command:</p><pre>$ git checkout master</pre><p>Now, that you are back on the master branch, delete the feature branch with the following command:</p><pre>$ git branch -d feature-branch-name</pre><p>If this doesn’t work, you may get a message asking you to enter the following instead:</p><pre>$ git branch -D feature-branch-name</pre><p>So, that pretty much covers it. This is how you go about collaborating and working on an app as a team using GitHub. It’s an extremely valuable tool for web developers and now you can use it, too!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5581d9f3643e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding AngularJS to a Rails App]]></title>
            <link>https://medium.com/@johnmessina_10236/adding-angularjs-to-a-rails-app-5e0a1da9da3b?source=rss-b4a863e1b504------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e0a1da9da3b</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angularjs]]></category>
            <dc:creator><![CDATA[John Messina]]></dc:creator>
            <pubDate>Mon, 06 Mar 2017 23:01:40 GMT</pubDate>
            <atom:updated>2017-03-06T23:01:40.488Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello again! My next blog post will get away from Ruby and deal with a new language and framework I’ve been learning. That language is JavaScript and the framework is AngularJS. AngularJS is a very powerful tool which extends HTML and can be used to make pages more dynamic. It is a library written in JavaScript.</p><p>Of course, the first thing we must do is add AngularJS to our Rails app so we can take advantage of all it has to offer. Follow the steps below to get AngularJS up and running:</p><p>1.) Go to the AngularJS website:<a href="https://angularjs.org/"><strong> https://angularjs.org/</strong></a> and download the uncompressed <strong>angular.js</strong> file.</p><p>2.) Within your Rails app, copy that file into the<strong> vendor/assets/javascripts</strong> folder.</p><p>3.) To the <strong>app/assets/javascripts/application.js</strong> file (also known as the asset pipeline), add the line <strong>//= require angular</strong> on the line above <strong>//= require_tree</strong>.</p><p>4.) In the same file, remove the<strong> //= require turbolinks </strong>line. I don’t know much about Turbolinks at this point, but I’ve been advised it can cause problems down the road.</p><p>5.) Create a new file inside <strong>app/assets/javascripts</strong> folder called <strong>app.js</strong>.</p><p>6.) To that file, add the following code:</p><pre>function() { <br>  &quot;use strict&quot;;   </pre><pre>  angular.module(&quot;app&quot;, []); </pre><pre>}());</pre><p>The “use strict” enables a JavaScript “strict mode” which detects more errors in your code and helps to prevent unsafe actions.</p><p>7.) Go back into the <strong>app/assets/javascripts/application.js</strong> file and add the line<strong> //= require app </strong>BELOW the <strong>//=require angular </strong>line. It must go in this position because it is dependent on Angular being loaded first.</p><p>There you have it! You are now ready to start working with AngularJS on your HTML pages.</p><p>Now, let’s do something very simple with Angular to test that it is working properly and to get a bit of a feel for how it works. First let’s create an Angular controller which will communicate back and forth with the HTML pages in our app. To do this, we must first create a file within the <strong>app/assets/javascripts</strong> folder. The name of the file is up to you, but it should be something logical that pertains to how it will function. For example, if it will be used in conjunction with an HTML page about products, we could call it <strong>product_ctrl.js</strong></p><p>Once this file has been created, place the following code in the file:</p><pre>function() { <br>  &quot;use strict&quot;;</pre><pre>}());</pre><p>Again, this enables a JavaScript “strict mode” and all our code will be written within this function.</p><p>Next, we must initiate our controller by adding code to the above:</p><pre>function() { <br>  &quot;use strict&quot;;</pre><pre>  angular.module(&quot;app&quot;).controller(&quot;productCtrl&quot;, function($scope) {</pre><pre>  });</pre><pre>}());</pre><p>The name of our controller is <strong>productCtrl</strong>. The name is up to you, but it makes sense to have it relate to the file name. Also, note the convention used in the name: lower camel case. The <strong>$scope </strong>is a part of AngularJS. It is an object with available properties and methods which can be used in both the view (HTML page) and the controller.</p><p>Now inside the controller, let’s do something simple. We can add code such as the following:</p><pre>function() { <br>  &quot;use strict&quot;;</pre><pre>  angular.module(&quot;app&quot;).controller(&quot;productCtrl&quot;, function($scope) {<br>  @scope.product = &quot;television&quot;;<br>  });</pre><pre>}());</pre><p>This will assign “television” to the variable <strong>product </strong>and associate it with the scope. Now, we can use the variable <strong>product </strong>in our view. In the view, we can write the following:</p><pre>&lt;div ng-app=&quot;app&quot;&gt;<br>  &lt;div ng-controller=&quot;productCtrl&quot;&gt;<br>    &lt;p&gt;{{ product }}&lt;/p&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>The <strong>&lt;div ng-app=”app”&gt; </strong>initiates AngularJS and <strong>&lt;div ng-controller=”productCtrl”&gt; </strong>initiates our controller. The <strong>&lt;p&gt;{{ product }}&lt;/p&gt; </strong>will display the variable <strong>product </strong>(in this case, “television”). The double curly braces {{}} denote an Angular variable within HTML. So, the above code would display the word “television” on our view page.</p><p>Congratulations! You are now on your way to developing dynamic apps with JavaScript and AngularJS!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e0a1da9da3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authorization]]></title>
            <link>https://medium.com/@johnmessina_10236/authorization-dc1faf1eb2d1?source=rss-b4a863e1b504------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc1faf1eb2d1</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[rails]]></category>
            <dc:creator><![CDATA[John Messina]]></dc:creator>
            <pubDate>Sun, 19 Feb 2017 12:33:25 GMT</pubDate>
            <atom:updated>2017-02-19T12:33:25.158Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to my next blog post. This post will deal with the topics of authorization and validations. First let’s deal with authorization. When we create and app, we don’t necessarily want every user to be able to do certain things within the app. For example, we might not want a user to have the abilty to delete or edit the contents of the app. To safeguard against this, we have the concept of authorization. Basically, we want to give a specific user or users administrative rights. Those users will have full access to the app, while non-administrative users will have more restricted access.</p><p>This post assumes you have already set up authentication for users in your app. Authentication allows a user to sign up, log in and log out of an app. A good tutorial for how to do this can be found here:</p><p><a href="https://gist.github.com/thebucknerlife/10090014">https://gist.github.com/thebucknerlife/10090014</a></p><p>To get started, we must add an attribute to our users table called “admin”. As discussed in my previous post, we would do this by creating a migration called something along the lines of “AddAdminToUser” and add the following code to the migration file:</p><pre>add_column :users, :admin, :boolean, default: false</pre><p>Boolean denotes the type of attribute and means it can either be true or false. Furthermore, we have set a default value of false to this attribute. So, whenever a new user is created, they will automatically NOT have administrative rights. We will have to manually change this to true for anyone we want to be an administrator. This makes the app much more secure.</p><p>Next, we must go into the application_contoller.rb file located in the app/contollers folder. Here we must define a method called authenticate_admin! We do this by writing the following code at the top of the file:</p><pre>def authenticate_admin!<br>  redirect_to&quot;/login&quot; unless current_user &amp;&amp; current_user.admin?<br>end</pre><p>We put the method in this file bcause we want all the contollers of our app to have access to it. Basically, this method is saying that unless a user is signed in and has administrative rights, redirect them back to the login page if they try to access a page you have deemed restricted.</p><p>Now, at the top of the contoller page for a specific aspect of your app (continuing with our example from the previous post that would be products_controller.rb located in the same folder as the application_controller.rb file) we can write code which would restrict a user’s access to certain methods in the controller. At the top of the file we could write the following code:</p><pre>before_action :authenticate_admin!, only: [:new, :create]</pre><p>Breaking this down, “before_action” designates code that should be run first (before certain other code is run). Next, “authenticate_admin!” indicates the method which should be run first (in this example, it is the method we created above). Finally, “only: [:new, :create]” specifies which methods in the products_controller.rb file we want to have restricted access. All the other methods in this file, will not require administrative rights.</p><p>Instead of the above, we could also write code such as the following:</p><pre>before_action :authenticate_admin!, except: [:index, :show]</pre><p>This would restrict access to all the methods in the file EXCEPT the ones designated (in this case, “index” and “show”). How you write the code is case specific and depends upon how many methods you want to have restricted access. For example, if your file contains many methods which you want restricted, it would be easier and shorter to use the “except” convention.</p><p>Don’t be suprised by some mischievous or malicious user who has completely altered your app. Now you can make your app more secure with administrator rights!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc1faf1eb2d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Databases and Migrations]]></title>
            <link>https://medium.com/@johnmessina_10236/databases-and-migrations-9872667995d8?source=rss-b4a863e1b504------2</link>
            <guid isPermaLink="false">https://medium.com/p/9872667995d8</guid>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[John Messina]]></dc:creator>
            <pubDate>Sat, 04 Feb 2017 22:13:50 GMT</pubDate>
            <atom:updated>2017-02-05T21:39:54.163Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog post will build upon my previous post about creating a Rails app. I will now discuss adding a database to the app where data can be stored and accessed. Earlier I stated to enter the following in your terminal to create a new Rails app:</p><pre>$rails new john-app</pre><p>To create a new Rails app WITH A DATABASE, you would instead write the following:</p><pre>$rails new john-app --database=postgresql</pre><p>The “postgresql” refers to a specific database system called PostgreSQL which is the one we are using in the course. Once you have done this, navigate into the app folder:</p><pre>$cd john-app</pre><p>From here, run the following command:</p><pre>$rails db:create</pre><p>This creates the database within the app (in this case, PostgreSQL ). Now that the database is created, we need to create a table within the database where we can store information pertaining to our app. For example, let’s say our app will render a website which will sell certain products. We will need to create a table to store information about each of these products. To keep things very simple, let’s say we want to store two pieces of data for each product: the name of the product and its price. We would create this table by writing the following:</p><pre>$rails generate model Product name &#39;price:decimal{5,2}&#39;</pre><p>Now let’s break down this command. The “rails generate model” is rails syntax that creates the table. “Product” is what I have chosen to call the table. What you put here is up to you, but it should make sense and represent the data that will be stored there. Also, note the format…it must be camel case and singular. After that come the attributes you want to store for each item (name and price in this case). You must specify a type for each attribute (you do this with a colon, no space) and you separate each attribute/type with a space. The default setting for an attribute is “string”, so you do not need to put the “:string” after an attribute you want to be a string. We also could have written the above as:</p><pre>$rails generate model Product name:string &#39;price:decimal{5,2}&#39;</pre><p>The syntax for the price attribute is a bit more complicated. Since we are assigning it the type “decimal”, we have to wrap the entire thing in single quotes and specify a precision and scale within curly braces. You can take a look at this page for information about types and syntax:</p><p><a href="http://railsguides.net/advanced-rails-model-generators/">Advanced Rails model generators</a></p><p>Creating this table will create a migration file in the db/migrate folder in the app. It is advised to check this file for any errors/typos at this time. Before doing the next step, changes can be made to this file. Once you are sure the everything is in order, run the following command in the terminal:</p><pre>$rails db:migrate</pre><p>Running this command will migrate (add) the table to the existing database. Do not alter the migration file after this step. At this point, if a change needs to be made to the table, another migration must be created to make the change. For example, let’s say we want to add an image url as an attribute to our products. To do this, we would run the following command:</p><pre>$rails generate migration AddImageToProducts</pre><p>Breaking this command down, “rails generate migration” is Rails syntax for creating a migration and AddImageToProducts is a name of your choosing for the migration. The name should describe the change being made (what you are changing and what table in the database it is affecting) and again should use the camel case convention. Once the migration is generated, open the corresponding file in the db/migrate folder. There you will see something like the following:</p><pre>class AddImageToProducts &lt; ActiveRecord::Migration[5.0]<br>  def change<br>  end<br>end</pre><p>Here is where you can add code to make the change to the database table. There are a variety of changes you can make. Continuing with our example of wanting to add an image url, you would add the following code to the “def change” method:</p><pre>class AddImageToProducts &lt; ActiveRecord::Migration[5.0]<br>  def change<br>    add_column :products, :image, :string<br>  end<br>end</pre><p>In the above code, “:products” refers to the table we want to modify, “:image” is the name of the attribute we want to add and “:string” defines the attribute type. Here we have made it a string because it will be a url. The following site is a useful resource for making changes in this manner:</p><p><a href="http://apidock.com/rails/v4.2.7/ActiveRecord/ConnectionAdapters/SchemaStatements/add_column">add_column (ActiveRecord::ConnectionAdapters::SchemaStatements) - APIdock</a></p><p>After you have written the code to make the change, double check to make sure it is accurate before proceeding to the next step. Once you have done that, once again run the following in your terminal:</p><pre>$rails db:migrate</pre><p>This will add the migration to the database and institute your desired change. The products will now have the added attribute of an image url associated with them.</p><p>So, there you have it. You can now create a database and be another step further in your creation of an awesome Rails app!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9872667995d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Rails App]]></title>
            <link>https://medium.com/@johnmessina_10236/creating-a-rails-app-83ce22edf3c2?source=rss-b4a863e1b504------2</link>
            <guid isPermaLink="false">https://medium.com/p/83ce22edf3c2</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[John Messina]]></dc:creator>
            <pubDate>Sat, 21 Jan 2017 23:57:32 GMT</pubDate>
            <atom:updated>2017-01-21T23:57:32.359Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to my first blog post. I am currently a student at Actualize where I am studying computer programming/coding. Here I will discuss concepts I am learning. This will be helpful to me as I can work through problems and hopefully be helpful to others looking to learn. This post will be about creating a Rails app and how the different components relate to each other. First off, you may be wondering what Rails is exactly. Well, Rails is a web application development framework written in a computer programming language called Ruby. It is designed to make building a web application easier.</p><p>With Rails installed on your computer, you can start building an app using the following steps. First, in your terminal you must run the command to create a new Rails app. You do this by typing “rails new app-name”. Note the convention for creating an app name: lower case with a dash or underscore separating words. Example:</p><pre>$rails new john-app</pre><p>This will build the framework for the app on your computer which you can then use to create your specific app.</p><p>Next, you must generate a Controller for the app. The Controller takes inputs/requests and delegates what should happen within the app. To generate a Controller, type “rails generate controller” and then the Controller name in your terminal. Note the convention for creating a Controller name: capitalized, camel case and plural. Example:</p><pre>$rails generate controller MyPages</pre><p>Next, you must open the app in a text editor (such as Sublime), in order to work with it. First navigate to the “routes.rb” file located in the “config” folder. Here you will enter the “routes” for the app (where a specific request will be directed). There are different commands that can be executed here, but for simplicity, I will just use the “get” command in this example. The get command is used when someone wants to get a webpage and directs the app where to go in order to accomplish this. Here is an example:</p><pre>Rails.application.routes.draw do<br>  get &quot;/about&quot;, to: &quot;mypages#about_me&quot;<br>end</pre><p>The “/about” is the end of the URL (the specific page on the server you want to view). With “pages#about_me”, pages refers to the name of the controller file (which Rails has already created) and about_me refers to a method we are going to create within that controller file. The hash mark is Rails syntax and must be included between the two.</p><p>Next, let’s go to the controller file to which we have routed. Navigate to the “app” folder and then the “controllers” folder and inside you will see two files: application_controller.rb and another controller.rb file with the name we used when we generated the controller. Open this second contoller.rb file. Here we will place the method which will run when we want to get a specific webpage. Continuing with our example:</p><pre>class MyPagesController &lt; ApplicationController<br>  def about_me<br>    render &quot;about_view.html.erb&quot;<br>  end<br>end</pre><p>The class has already been created by Rails with the name we used when we generated the controller. In this example, I have defined the about_me method (which we routed to above). Keeping it simple, it will just render a webpage based on code we will put into the about_view.html.erb file.</p><p>Now we must create the about_view.html.erb file (“HTML” is a language which a browser interprets to render a webpage and “erb” stands for embedded Ruby which means we can embed Ruby code within this HTML file). Navigate to the “app” folder and then the “views” folder. Here you will see two folders: “layouts” and another folder Rails created with the Controller name. Navigate into this second folder. Inside this folder create a new file with the exact name of the file which we are rendering in our method (about_view.html.erb in this example).</p><p>In this file, we will put our HTML and Ruby code which the browser will use to render the webpage. Example:</p><pre>&lt;h1&gt;This page is all about me, me, me!&lt;/h1&gt;</pre><p>Again, just to keep it simple, I have chosen to output a simple sentence using the HTML &lt;h1&gt; tag. So, with all we have done, when we go to the “/about” page on the server, it will display the text above. I think it’s all very cool and nifty. :-)</p><p>Well, that’s about it for my first blog post. I hope you have found it informative and that you will continue to follow me on my journey through the Actualize program.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83ce22edf3c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>