<?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>DEV Community: Kat</title>
    <description>The latest articles on DEV Community by Kat (@melo616).</description>
    <link>https://dev.to/melo616</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%2F1118590%2Fc5c7c769-e2c8-4035-a8ac-1c7728a29869.png</url>
      <title>DEV Community: Kat</title>
      <link>https://dev.to/melo616</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/melo616"/>
    <language>en</language>
    <item>
      <title>Authentication and Security</title>
      <dc:creator>Kat</dc:creator>
      <pubDate>Wed, 25 Oct 2023 16:44:29 +0000</pubDate>
      <link>https://dev.to/melo616/authentication-and-security-594f</link>
      <guid>https://dev.to/melo616/authentication-and-security-594f</guid>
      <description>&lt;p&gt;Some of the methods we employ to address security issues are:&lt;br&gt;
-&lt;code&gt;before_action&lt;/code&gt;: We place this in the controller and name a function that we will write below in the private section that will be run before executing the specified routes. So for instance, &lt;code&gt;before_action :is_authorized_user, only: [:destroy, :create]&lt;/code&gt; will run the function &lt;code&gt;is_authorized_user&lt;/code&gt; before the create and destroy routes. We place them in the private section to follow the OOP principle of encapsulation and to increase security. This function outlines the logic determining if the current user is authorized to perform the create or destroy methods. &lt;br&gt;
-&lt;code&gt;skip_before_action&lt;/code&gt;&lt;br&gt;
-&lt;code&gt;redirect_to&lt;/code&gt;&lt;br&gt;
-&lt;code&gt;redirect_back&lt;/code&gt; will send the user to the route from which they came, and we can add &lt;code&gt;fallback_location&lt;/code&gt; to specify where we want them to be sent in the case that your application can't tell what the previous page was. You can also add a notice. &lt;br&gt;
-&lt;code&gt;current_user&lt;/code&gt; &lt;br&gt;
-&lt;code&gt;if&lt;/code&gt;/&lt;code&gt;else&lt;/code&gt; conditional statements&lt;br&gt;
-&lt;code&gt;only:&lt;/code&gt; and &lt;code&gt;except:&lt;/code&gt; to limit the routes that are generated in &lt;code&gt;resources&lt;/code&gt; (e.g. there's no point in having a delete route for something you don't want to be deletable).&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Industrial Grade Codebase: Associations and Validations</title>
      <dc:creator>Kat</dc:creator>
      <pubDate>Tue, 24 Oct 2023 20:39:26 +0000</pubDate>
      <link>https://dev.to/melo616/industrial-grade-codebase-associations-and-validations-5anj</link>
      <guid>https://dev.to/melo616/industrial-grade-codebase-associations-and-validations-5anj</guid>
      <description>&lt;p&gt;Some additional notes about ways you can modify your tables in your ActiveRecord migrations:&lt;/p&gt;

&lt;p&gt;-You can use &lt;code&gt;index: false&lt;/code&gt; to shut off indexing. This is useful because each index you add to your table increases how much storage space it takes up. This is especially important if the size of your table is large. Additionally, indexes slow down Create, Update, and Delete operations because the index needs to be updated along with the rest of that data.&lt;/p&gt;

&lt;p&gt;-&lt;code&gt;null: false&lt;/code&gt; makes it so that this column cannot be empty.&lt;/p&gt;

&lt;p&gt;-You have to use a &lt;code&gt;class_name: "Example"&lt;/code&gt; in your association in the case that you are deviating from convention. Conversely, you use `foreign_key: "example_id" when the foreign key deviates from convention. Class_name specifies the model you are connecting to with the association, whereas foreign_key specifies the column in the table that connects to the model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Association Accessors&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;belongs_to&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;belongs_to&lt;/code&gt; is a direct association accessor. It adds an automatic validation to foreign key columns making a foreign key required unless you override this by adding &lt;code&gt;optional: true&lt;/code&gt;. If you remove &lt;code&gt;null: false&lt;/code&gt; from any foreign key column in the migration file, you must add &lt;code&gt;optional: true&lt;/code&gt; to the corresponding &lt;code&gt;belongs_to&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;counter_cache&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;counter_cache&lt;/code&gt; can be added to any &lt;code&gt;belongs_to&lt;/code&gt; to keep track of the number of children objects.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Industrial-Grade Codebase: Setting up Data Tables with Devise, Scaffolds, Models</title>
      <dc:creator>Kat</dc:creator>
      <pubDate>Tue, 24 Oct 2023 16:38:02 +0000</pubDate>
      <link>https://dev.to/melo616/industrial-grade-codebase-setting-up-data-tables-with-devise-scaffolds-models-3335</link>
      <guid>https://dev.to/melo616/industrial-grade-codebase-setting-up-data-tables-with-devise-scaffolds-models-3335</guid>
      <description>&lt;p&gt;We are writing industrial-grade code to learn about building up a project from scratch in Ruby on Rails. This blog post will serve as a reference for future projects and attempt to compile and understand what we have learned so far.&lt;/p&gt;

&lt;p&gt;For the users table, we're using Devise, one of the most popular authentication GEMS (?) in Rails.&lt;/p&gt;

&lt;p&gt;Gem groups allows us to specify gems we want to use in development, production, or all of the time. By compartmentalizing gems like this, it saves memory to not load all the gems all of the time.&lt;/p&gt;

&lt;p&gt;We first add &lt;code&gt;gem "Devise"&lt;/code&gt; and then &lt;code&gt;bundle install&lt;/code&gt; and &lt;code&gt;rails generate devise:install&lt;/code&gt; to complete the installation process for Devise. We then have to follow the steps Devise requires in order to use it. The first is defining a root route in the controller.&lt;/p&gt;

&lt;p&gt;Once this is taken care of, we generate the users table using &lt;code&gt;rails g devise user username private:boolean likes_count:integer comments_count:integer&lt;/code&gt;. Keep in mind string is the default datatype so we can leave that off as is the case with defining username above.&lt;/p&gt;

&lt;p&gt;We also then change username and email to citext in our migration. This stands for case-insensitive text and means the column will not be case sensitive thus ensuring you can't have the same username as someone else but with different capitalization, for instance. Don't forget to add the line &lt;code&gt;enable_extension("citext")&lt;/code&gt; at the top of your migration to use this. This datatype is a feature of PostgreSQL.&lt;/p&gt;

&lt;p&gt;Some things devise does:&lt;br&gt;
-It has steps for handling a forgotten password built in&lt;br&gt;
-It has a bunch of pregenerated columns you can add in to track different user data or activity&lt;br&gt;
-It adds the line &lt;code&gt;add_index :users, :email, unique: true&lt;/code&gt;. This speeds up lookups. Otherwise you would have to scan through the entire database to find what you're looking for.  Devise does it automatically for email and a good idea to add  index for usernames as well since you look users up by username frequently. Adding &lt;code&gt;unique: true&lt;/code&gt; adds a database-level check for enforcing uniqueness. On rare cases regular validations may fail so the uniqueness enforcement will be stronger with the added fortification of a database-level check. Also, primary keys are indexed automatically so this isn't necessary for those columns.&lt;/p&gt;

&lt;p&gt;For things with a count set a default value, such as likes_count and comment_count. These should generally be initialized to zero. If you don't set a default value, Devise's default is a nil value which can cause issues.&lt;/p&gt;

&lt;p&gt;Once the migration is all set up run &lt;code&gt;rake db:migrate&lt;/code&gt; and your users table is good to go. (If you have issues run &lt;code&gt;rake db:drop&lt;/code&gt; then &lt;code&gt;rake db:create&lt;/code&gt; to set up your database.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting up the rest of your data tables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you're setting up the rest of the tables figure out if it's better to generate a scaffold or a model for each. In general, if your users need to be able to commit CRUD functions in your app, use scaffold. If the model will only be used by other models in the backend, use model.&lt;/p&gt;

&lt;p&gt;Delete the &lt;code&gt;null: false&lt;/code&gt; option in a column if you want it to have the option of being blank.&lt;/p&gt;

&lt;p&gt;Don't forget to update all your associations if you want to use more descriptive foreign key column names than convention.&lt;/p&gt;

&lt;p&gt;You will have to use &lt;code&gt;to_table&lt;/code&gt; to clarify the table name the foreign key points to when deviating from convention as well. That looks like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;t.references :owner, null: false, foreign_key: { to_table: :users }&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Helper Methods in Ruby</title>
      <dc:creator>Kat</dc:creator>
      <pubDate>Fri, 13 Oct 2023 20:45:48 +0000</pubDate>
      <link>https://dev.to/melo616/helper-methods-in-ruby-5145</link>
      <guid>https://dev.to/melo616/helper-methods-in-ruby-5145</guid>
      <description>&lt;p&gt;With the introduction of scaffolding and helper methods, there's a lot of new information to keep track of and a lot of the information that I learned previously will no longer be used regularly. I'm writing this blog post to organize some of the new material and for quick reference for later use.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post is a work in progress and I will be gradually adding to it over the next few days as I revisit the last few lessons.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting up your project: Scaffolding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you open up a new, blank Rails project, the first step is to set up your MVC. Rails has an easy built-in generator that doesn't require a gem in order to run: &lt;code&gt;scaffold&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To use the scaffold generator, type the following into a bash prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rails generate scaffold &amp;lt;table_name_singular&amp;gt; &amp;lt;column_name&amp;gt;:&amp;lt;data_type&amp;gt; &amp;lt;column_name&amp;gt;:&amp;lt;data_type&amp;gt; &amp;lt;column_name&amp;gt;:&amp;lt;data_type&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run this and then run &lt;code&gt;rake db:migrate&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;What's included with this?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the model.rb for the database table&lt;/li&gt;
&lt;li&gt;RESTful starter routes (CRUD) using conventional naming patterns&lt;/li&gt;
&lt;li&gt;corresponding templates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once these are set up, they must be edited for your own needs! It's just starter code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;New Syntax&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As we move into this new way of doing things, we are using updated and more professional/concise syntax in our projects.&lt;/p&gt;

&lt;p&gt;What does this look like? We'll use the database table name "movies" like we did in lecture.&lt;/p&gt;

&lt;p&gt;In routes.rb:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;get "/movies", controller: "movies", action: "create"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;becomes:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;post "/movies" =&amp;gt; "movies#create"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Additionally, the root route has its own syntax:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;root "movies#index&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Further, we will assign method names to each route in the routes.rb file and refer to the routes by their method names in any other file in the project instead of by the url. This helps a lot if you ever have to change the name of the route - rather than going through your whole project and finding any reference to the route, you can just change the method name in routes.rb.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;post "/movies" =&amp;gt; "movies#create", as: :movies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The convention for each route is as follows:&lt;br&gt;
Create: &lt;br&gt;
/movies/new = :new_movie&lt;br&gt;
post /movies = :movies&lt;/p&gt;

&lt;p&gt;Read:&lt;br&gt;
/movies - you don't have to put anything.&lt;br&gt;
/movies/:id = :movie&lt;/p&gt;

&lt;p&gt;Update:&lt;br&gt;
patch - you don't have to put anything.&lt;br&gt;
/movies/:id/edit = :edit_movie&lt;/p&gt;

&lt;p&gt;Delete:&lt;br&gt;
You don't have to put anything for this route.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I don't really get why you don't have to put the helper method for all of them so I have to figure that out.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;link_to&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;link_to&lt;/code&gt; helper method is generates links for you as opposed to having to write them yourself. It enables you to use the route method names you previously set up and can actually find these by itself if you're using conventional naming patterns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;form_with&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;form_with&lt;/code&gt; helper method can replace the &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt; HTML tag and has a few benefits including automatically generating the authenticity token we need to prevent malicious attacks (cross-site request forgery). Forms with a path other than get cannot be submitted without this token. It takes a hash as an argument that contains the path. You can also include the method if it's something like patch so you don't have to include this as a hidden input anymore. We are also including &lt;code&gt;data: {turbo: false}&lt;/code&gt; because turbo is automatically on in the version of Ruby we're using.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;form_with&lt;/code&gt; is a code block so you have to then end the block at the end of the form. &lt;/p&gt;

&lt;p&gt;We use a label tag like so:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;%= label_tag :description, "Description" %&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The first argument to the &lt;code&gt;label_tag&lt;/code&gt; is the &lt;code&gt;for=&lt;/code&gt; attribute from our old label tags, which connects the label to the input field via the input field's ID. The second one is the content if that's something different - what the label actually says.&lt;/p&gt;

&lt;p&gt;There are different helper methods for each type of input such as a text area, checkbox, etc.  For these, the first argument is the name &amp;amp; id (if they're the same) and the second populates the value attribute. You can also add a hash for additional attributes like rows in a text area or the id if it's not the same as the name.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Databases with Rails: Review</title>
      <dc:creator>Kat</dc:creator>
      <pubDate>Thu, 28 Sep 2023 17:15:30 +0000</pubDate>
      <link>https://dev.to/melo616/databases-with-rails-review-1pi7</link>
      <guid>https://dev.to/melo616/databases-with-rails-review-1pi7</guid>
      <description>&lt;p&gt;Here is a recap of some of the main points regarding databases and using databases with Ruby on Rails for reference compiled from the information from class.&lt;/p&gt;

&lt;p&gt;Relational databases are databases structured around the data type "relation", which refers to a set of records modeled off a table. Relational databases use SQL. The apps that we build output SQL commands that create, read, update, or delete rows of data and send them to the database for processing. &lt;/p&gt;

&lt;p&gt;To create a database and start working with it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Launch &lt;code&gt;psql&lt;/code&gt; from a bash prompt&lt;/li&gt;
&lt;li&gt;In psql, create a database using the command &lt;code&gt;CREATE DATABASE &amp;lt;database_name&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Connect to the database with the command &lt;code&gt;\connect &amp;lt;database_name&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create a table with the command
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  CREATE TABLE &amp;lt;table_name&amp;gt; (
    ---table columns and datatype---
  );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Configure the Rails application to use the database by editing config/database.yml line 26 (current) to: &lt;code&gt;database: &amp;lt;database_name&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create a model called the singular form of the corresponding table name and inherit from ActiveRecord::Base.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To work with your database, use the terminal command &lt;code&gt;rails console&lt;/code&gt; or &lt;code&gt;rails c&lt;/code&gt; which launches psql and automatically connects to the database specified in config/database.yml.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ActiveRecord&lt;/strong&gt;&lt;br&gt;
ActiveRecord is a Ruby gem that automates most of the process of connecting to your database and performing CRUD operations.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Cookies</title>
      <dc:creator>Kat</dc:creator>
      <pubDate>Tue, 08 Aug 2023 03:49:30 +0000</pubDate>
      <link>https://dev.to/melo616/cookies-172o</link>
      <guid>https://dev.to/melo616/cookies-172o</guid>
      <description>&lt;p&gt;We use cookies every day but I've never really understood what they do or how they work. The lesson "the cookies hash" was helpful in elucidating the basic concept of what cookies are and what they do.&lt;/p&gt;

&lt;p&gt;Essentially, cookies are "a set of key-value pairs" that the server stores in the client. Simple! Then, the data are sent back to the server with a header "Cookie" every time the client makes another HTTP request. Thus, the server can keep track of things like client preferences or the identity of a logged-in user.&lt;/p&gt;

&lt;p&gt;The cookies hash can be accessed using the same hash methods as a regular hash. However, the keys and values can only be stored as strings. Thus, any other data type must be encoded as a string and later decoded back into the data type it was originally. The best way to do this is through the use of JSON strings. For this process, we use the methods &lt;code&gt;JSON.parse(string)&lt;/code&gt; and &lt;code&gt;JSON.generate(hash)&lt;/code&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Views and more</title>
      <dc:creator>Kat</dc:creator>
      <pubDate>Mon, 07 Aug 2023 16:42:43 +0000</pubDate>
      <link>https://dev.to/melo616/views-and-more-ho6</link>
      <guid>https://dev.to/melo616/views-and-more-ho6</guid>
      <description>&lt;p&gt;To incorporate Ruby and HTML together in a page, Sinatra provides a folder called views, where you can put .erb files. These files are primarily HTML but you can add erb tags to inject some Ruby, which your browser will read as the HTML the Ruby code snippets represent. This is a great way to put logic or variables directly into your HTML templates.&lt;/p&gt;

&lt;p&gt;If you have code that will be repeated in various templates, this can be placed in the folder layout.erb. The code from the other erb files will appear where you place the &lt;code&gt;&amp;lt;%= yield %&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;Putting &lt;code&gt;{ :layout =&amp;gt; false }&lt;/code&gt; in the app.rb file for a specific route will turn off the layout for that particular view, or you can override the layout with a different one using &lt;code&gt;{ :layout =&amp;gt; :other_layout }&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;use :variable in your path to create a dynamic variable. The variable params allows us to get those in the form of a hash.&lt;/p&gt;

&lt;p&gt;We also learned about the importance of automated tests. They're super helpful when refactoring code to make sure that the functionality of the original has been maintained, and can test a number of user inputs automatically. While writing the code for these tests takes some time, possibly longer than writing the code that will be tested itself, it is a great time investment as it ensures functional code over time and over changes to the codebase.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Classes</title>
      <dc:creator>Kat</dc:creator>
      <pubDate>Mon, 31 Jul 2023 18:02:03 +0000</pubDate>
      <link>https://dev.to/melo616/classes-4nfc</link>
      <guid>https://dev.to/melo616/classes-4nfc</guid>
      <description>&lt;p&gt;Classes serve as a blueprint for instances of objects in programming. Today I learned about creating classes in Ruby. A few notes:&lt;/p&gt;

&lt;p&gt;-We only use capital letters in Ruby when referring to classes.&lt;br&gt;
-A multi-word class name should be in CamelCase.&lt;br&gt;
-The keyword &lt;code&gt;attr_accessor&lt;/code&gt; is used to declare the attributes of a class.&lt;br&gt;
-We can define our own methods within a class using the keyword &lt;code&gt;def&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here is an example of a class with a class method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Cat
  attr_accessor :name
  attr_accessor :age
  attr_accessor :fur_color

  def meow
    return self.name + " says 'Meow!' :3"
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another important keyword in classes is &lt;code&gt;self&lt;/code&gt;. According to the learn materials, this keyword "refers to the class it is inside of and can be used to refer to all the attributes of that class".&lt;/p&gt;

&lt;p&gt;Additionally, this module discusses inheritance, which is one of the four pillars of object-oriented programming, or OOP, the most commonly used modern programming paradigm. Inheritance basically means that you can create subclasses of any class that inherit the attributes and methods of the parent class (but also have their own!).&lt;/p&gt;

&lt;p&gt;The syntax to a subclass is:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;class SubClass &amp;lt; ParentClass&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Ruby Syntax: Each</title>
      <dc:creator>Kat</dc:creator>
      <pubDate>Sat, 29 Jul 2023 15:50:13 +0000</pubDate>
      <link>https://dev.to/melo616/ruby-syntax-each-27fb</link>
      <guid>https://dev.to/melo616/ruby-syntax-each-27fb</guid>
      <description>&lt;p&gt;Today's module introduced a really interesting array method in Ruby: each. This is an efficient way to loop over elements in an array in Ruby. &lt;/p&gt;

&lt;p&gt;"Each" can be used with "do" and a block variable to create an iterative loop rather than using a while loop or for loop and has the benefit of not requiring a value to be incremented in order to move to the next element in the array. Also, it doesn't require us to know the number of elements in the array, as would be the case if we used .times. &lt;/p&gt;

&lt;p&gt;This makes our code more concise!&lt;/p&gt;

&lt;p&gt;Here is an example of how to print each element in an array using .each:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_array = ["cat", "dog", "hamster", "frog", "parakeet"]
my_array.each do |animal|
  pp animal
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>TIL...GitHub pages!</title>
      <dc:creator>Kat</dc:creator>
      <pubDate>Wed, 26 Jul 2023 19:59:27 +0000</pubDate>
      <link>https://dev.to/melo616/tilgithub-pages-3d69</link>
      <guid>https://dev.to/melo616/tilgithub-pages-3d69</guid>
      <description>&lt;p&gt;For today's assignment, I used GitHub pages for the second time to deploy a project. It's great to have such a simple way to deploy websites directly through GitHub! I plan to use this method moving forward to deploy projects I have built in order to demonstrate my portfolio to potential employers/collaborators. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>TIL...</title>
      <dc:creator>Kat</dc:creator>
      <pubDate>Wed, 12 Jul 2023 22:57:07 +0000</pubDate>
      <link>https://dev.to/melo616/til-3e75</link>
      <guid>https://dev.to/melo616/til-3e75</guid>
      <description>&lt;p&gt;First post! Testing 1 2 3...&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
