<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: jCode319</title>
    <description>The latest articles on Forem by jCode319 (@jcode319).</description>
    <link>https://forem.com/jcode319</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F476823%2F88dd0608-82dc-4336-b0af-4b6b8292cf1c.jpg</url>
      <title>Forem: jCode319</title>
      <link>https://forem.com/jcode319</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jcode319"/>
    <language>en</language>
    <item>
      <title>Cheers, the Drinkbook! – My Sinatra Application.
</title>
      <dc:creator>jCode319</dc:creator>
      <pubDate>Thu, 03 Dec 2020 20:03:07 +0000</pubDate>
      <link>https://forem.com/jcode319/cheers-the-drinkbook-my-sinatra-application-2m52</link>
      <guid>https://forem.com/jcode319/cheers-the-drinkbook-my-sinatra-application-2m52</guid>
      <description>&lt;p&gt;“Come Fly(Drink) with me…”&lt;/p&gt;

&lt;p&gt;I recently finished curating my very first fully working Ruby application using Sinatra &amp;amp; Active Record. I wanted to design an app that allowed users to keep track of their cocktail/drink recipes as well as view other user’s in the community. This was my second project as part of my coursework for Flatiron’s Full Stack Developer Program. I must say this was my “Ah-ha” moment within the program. After completing this project, I felt more confident in my Ruby skills, including: debugging, better understanding of classes and instances as well as how the internet works on the backend. My app followed the MVC pattern and utilized the CRUD operations in order to make a seamless user experience. &lt;/p&gt;

&lt;p&gt;This project was a level up from my first CLI project because it allowed the user to keep track of their data in the database via the magic of Active Record which served as the ORM. Even though this project was more complicated, the gems, especially Corneal, along with a few macros made the overall experience smoother because it did a lot of the heavy lifting within the app. It also forced me to understand concepts better because I wanted to know what was actually occurring. I know as the program continues, processes will become more and more abstract and I don’t want to lose my way in process. &lt;/p&gt;

&lt;p&gt;Following the installation of the Corneal gem, which provided a lot of the essential documentation, folders and useful gems. I obviously had to go in and make the necessary adjustments to best fit my app. Once my framework was prepped and ready, I started by creating my database tables and migration files. Those migration files inherited from Active Record in order to create those tables and establish the connection between each object. I had an User and Recipe table. The relationship included: User -&amp;lt; Recipes: Users have many recipes and a recipe belong to a User. These wonderful macros created those method attributes that would be useful after migration. The migration worked properly because I was given a schema file that displayed the created of those tables.&lt;/p&gt;

&lt;p&gt;Now onto the controllers, which handled a lot of the logic between the database(model) and the user(views), which I will touch on later. To follow convention, I decided to create an application controller, which inherited from Sinatra and held all of my helper methods as wells various configurations that would be needed throughout this app. By inheriting from Sinatra, it gave my program access to the routes and HTTP Verbs (Get/Post/Put/Patch/Delete), among other things. My other two controllers included a user and recipe controller. Since the application controller was the high-level one, the other two inherited from it in order to make things seamless. This was done in case of any updates or changes that would affect all three and the simple fact that you can only run one file at a time. With that said, it was important to run the application controller within the config.ru folder and only use the other two. The configu.ru folder also housed the rake::override task that I’ll touch on later.&lt;/p&gt;

&lt;p&gt;Since this app performs CRUD actions, it was important to include those within the user and recipe controllers. I utilized 7 restful routes in order to make the application functional. The Create route captured the data provided from the user via a Get request and created an instance of an user and recipe object in the database through a Post route. This was executed with the user filled out a form. The Read action was handled via a different Get route by locating the specific user or recipe based on the primary key that was assigned with the object was created and saved to the database. Out of all the actions, Update was the trickier route because it handled having to locate the object and making the necessary edits and then Putting/Patching that info to the database. I also had to include logic to ensure the protection of the user’s info as well as avoiding bad data from entering the database. This was executed via the method override function that I mentioned earlier. It gave the ability to make those changes via a post request since web pages do not recognized Put Patch and Delete request. Speaking of Delete, it used the same functionality as the update action but must simpler. After locating the object, I simply called destroy on it to remove the info from the database.&lt;/p&gt;

&lt;p&gt;All the routes were associated to the view page in some capacity, whether they were rendered directly or via a redirect route that would eventually rendering the erb file. This ORM magic allowed data to be parse via ruby code and rendered for the user to view and understand. The View housed the index, show, edit and new pages. The forms that collected data from the user were housed within the new and edit files. These pages also contained html and css files for styling affect and in order to make the data persisted from the database readable. One thing I wish I had more time to work on would have been the customization of the app. I did learn a lot on the spot and look forward to implementing more on my next projects. Overall, this was a fun project to embark o&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Command Line Interface with Ruby Anyone?!</title>
      <dc:creator>jCode319</dc:creator>
      <pubDate>Mon, 26 Oct 2020 03:57:24 +0000</pubDate>
      <link>https://forem.com/jcode319/command-line-interface-with-ruby-anyone-1nl</link>
      <guid>https://forem.com/jcode319/command-line-interface-with-ruby-anyone-1nl</guid>
      <description>&lt;p&gt;Week 4 aka Phase 1 Project Week was all about building a CLI (command-line interface) application with Ruby. I will admit, I was both excited and nervous at the idea of embarking on this journey. I was gradually increasing my Ruby skills and this would be my first test... no pressure.&lt;/p&gt;

&lt;p&gt;The project consisted of using a website to extract info either via Scraping or using an API. We would need to scrape the data using Nokogiri and use that collection of information to put together a functional user interface. Our scrape also had to include a nested layer that would reveal additional information within the program. Lastly, this application needed to include quality object-oriented design patterns.&lt;/p&gt;

&lt;p&gt;Leading up to project week, I was a little behind in the labs and was not picking up on some of the Classes/Instances material as I had hoped but I was determined to catch up and get through it by any means necessary. Lucky for me, I had awesome and talented cohort teammates who assisted me along the way and our instructor laid out a great framework for the project. In addition, we had an opportunity to see former students' projects which helped calm my nerves a bit.&lt;/p&gt;

&lt;p&gt;Since part of the requirement was having some form of relationship between my classes I decided to do my project on cocktails because who doesn't like a yummy adult beverage!!! My relationship would include Technique/Method -&amp;lt; Cocktails: Technique has many Cocktails and Cocktails belongs to a Method/Technique. My first level scrape retrieved the cocktail name, drink making method / technique and a second url that would lead to the second scrape that gathered the description and ingredients for each cocktail. &lt;/p&gt;

&lt;p&gt;Prior to writing code, I needed to pick a website to scrape so I browsed around looking for a website about cocktails that wouldn't be too difficult to scrape since the process was tedious and require a little trial and error. I settled on Liquor.com because the website was clean with a lot of repeating content/layout. The process of extracting info via Nokogiri was fairly easy; however, the trick came in trying to find the right formula for each category of info that I was looking for and ensuring I was in the right element tags. This is apart of the project where I got very familiar with binding.pry. This proved to be the answer to a lot of trial and error testing.&lt;/p&gt;

&lt;p&gt;Now having completed this process, if I ever had to scrape a website, I would definitely know what to lookout for during my initial canvasing and avoid complicated sites. This would save countless hours scraping bogus sites and wasting precious time. &lt;/p&gt;

&lt;p&gt;Once my scrapes were functional and providing the correct content that I looking for, I started pseudo coding the user interface which was a giant loop. This also provide an idea of what I wanted the program to do, which kept me on track. This wasn't the prettiest, but it worked! The relationships between the info really helped with the creation and organization of my classes and files. &lt;/p&gt;

&lt;p&gt;For the sake of time, this application only has 1 technique - shaken cocktails; however, the OOP code makes it abstract enough that it would be able to adapt to additional techniques being filtered through the scraper class. The project was a rude awakening of facing fears and how to navigate through failure in order to achieve success. I learned a lot throughout this process and proud of my little simple cocktail_pedia application.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>ruby</category>
    </item>
    <item>
      <title>“Why I decided to study Software Engineering?”</title>
      <dc:creator>jCode319</dc:creator>
      <pubDate>Mon, 28 Sep 2020 17:39:03 +0000</pubDate>
      <link>https://forem.com/jcode319/why-i-decided-to-study-software-engineering-4gf</link>
      <guid>https://forem.com/jcode319/why-i-decided-to-study-software-engineering-4gf</guid>
      <description>&lt;p&gt;2020 has been a year for the record books! Partly due for a few unfortunate circumstances: Kobe Bryant's death, Coronavirus, BLM, Chadwick Boseman's death and a crazy election cycle. Despite the negativity in the world, this year has also birthed some positivity in my life...&lt;/p&gt;

&lt;p&gt;Prior to the pandemic, I spent 15 years building my Hospitality and Tourism career and with several jobs including my recent Director of Events role. All that growth came to a complete halt in March when my company furloughed all of it's employees. Like many people who were on lockdown, I spent the next two weeks binging Netflix, doing social media challenges, attending virtual happy hours and falling into the dark tunnel world of Tik-Tok! &lt;/p&gt;

&lt;p&gt;In April, I quickly accepted the reality that my industry was not going to bounce back from this pandemic as quickly as I had originally anticipated. Therefore, I began mapping out a  career shift for my peace of mind and future financial stability. I quickly turned to the world of tech, which was my second love behind planning events and curating memorable experiences for people. I reached out to a few friends who were in the industry and they recommended that I look into coding schools. I took their advice and immediately started doing my research.&lt;/p&gt;

&lt;p&gt;After countless interviews, conversations, and basic coding prep courses, I was sold on the idea of switching careers to software engineering. I finally settled on Flatiron School for a plethora of reasons, specifically the community that they fostered, which would make diving in the sea of the unknown, more bearable!&lt;/p&gt;

&lt;p&gt;I haven't really declared which route I would go with software engineering but I plan on letting my experience learning to navigate which type of developer I become. &lt;/p&gt;

&lt;p&gt;Pssst... I think I'll like front-end development more but stay tuned to see if this remains true in the end.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;- - Jcode out!&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>firstyearincode</category>
    </item>
  </channel>
</rss>
