<?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 Eveline Guerrero on Medium]]></title>
        <description><![CDATA[Stories by Eveline Guerrero on Medium]]></description>
        <link>https://medium.com/@evelineguerrero23?source=rss-7209205de899------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xciKTkoXW6FNt1d8SMWveA.jpeg</url>
            <title>Stories by Eveline Guerrero on Medium</title>
            <link>https://medium.com/@evelineguerrero23?source=rss-7209205de899------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:38:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@evelineguerrero23/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[Serializers]]></title>
            <link>https://medium.com/@evelineguerrero23/serializers-131e62d26b47?source=rss-7209205de899------2</link>
            <guid isPermaLink="false">https://medium.com/p/131e62d26b47</guid>
            <dc:creator><![CDATA[Eveline Guerrero]]></dc:creator>
            <pubDate>Wed, 04 May 2022 18:29:38 GMT</pubDate>
            <atom:updated>2022-05-05T16:57:31.115Z</atom:updated>
            <content:encoded><![CDATA[<p>We use serializers to customize the data rendered to the screen or the data we send in the json data response. Controllers offload the customization to the serializer generator and with one command it will connect the controller to its’ serializer. We can also build custom serializers to include other data connected by tables. For my examples, I will be using my Phase 5 react/rails web app. In my app, Users are able to log in, view their groups, post events in their groups, comment and add them to a calendar. The purpose of my app is to help people schedule events with groups of people easily.</p><p>First, we start off by installing the gem in our Gemfile and run bundle install.</p><p><strong>gem ‘active_model_serializers</strong></p><p>Next, I am going to create a serializer for my Users controller with this simple command:</p><p><strong>rails g serializer User</strong></p><p>This command will generate our serializer and now we have to add our attributes that we want rendered in our json data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*KGq_SYZQAc_K9el9ZacVSw.png" /></figure><p>Now if I go to localhost:3000/users, the appropriate json data is rendered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*Cfwc0zL3uHmjifN0_cIKOg.png" /></figure><p>If I simply wanted to include the users’ groups with the json data, I can simply include it by adding the associated macro: ‘has_many :groups’ because Users and Groups is a many_to_many relationship through a join table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*MH1XsXJ4GtzDDpKqBXnKlQ.png" /></figure><p>Now if i go to localhost:3000/users again, the Users data will include its’ groups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*fV1m-kzU9fxLsa8UrI0XAQ.png" /></figure><p>Now in the frontend of my app I can fetch to access each users’ groups! How cool!</p><p>Next I will build a custom serializer. If I wanted to render this json data for a specific action, I will have to create a custom serializer by using both controller names like so:</p><p><strong>rails g serializer UserGroup</strong></p><p>Then add its’ attributes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*IH1qAKzz1ad7gqpRRCshqA.png" /></figure><p>Then I will have to add it the the specific controller action the serializer was created for, like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*lRu-9uO7WQcN8rvt19fJng.png" /></figure><p>And we get the appropriate data response just for the specific controller action! Awesome!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*PJfNihxLWbuIkMxxQBQZnA.png" /></figure><p>Bye!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=131e62d26b47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up Rails API]]></title>
            <link>https://medium.com/@evelineguerrero23/setting-up-rails-api-332de0d65329?source=rss-7209205de899------2</link>
            <guid isPermaLink="false">https://medium.com/p/332de0d65329</guid>
            <dc:creator><![CDATA[Eveline Guerrero]]></dc:creator>
            <pubDate>Wed, 20 Apr 2022 16:38:51 GMT</pubDate>
            <atom:updated>2022-04-20T17:14:24.181Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, at Flatiron, I embarked on the journey to learn Rails and how to build a full crud app with a react frontend. Today I will be showing you how to setup a backend API using rails.</p><p>First, we have to establish what are tables will be and their relationships.</p><p>In my example, we have a many to many relationship where</p><ul><li>A Scientist has many Missions, and has many Planets through Missions</li><li>An Planet has many Missions, and has many Scientists through Missions</li><li>A Mission belongs to a Scientist and belongs to a Planet</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*WemTIx9NyHThngynH5AvCQ.png" /></figure><p>ok, so now we run a command that will create a table and our models for us at the same time. We want to use &lt;rails g model&gt;and then the name of the model. Make sure it’s singular. We follow the model name by the attributes. If their type is not declared, it will default to a string. Since Missions belongs to scientists and planets we can simply write out scientist:belongs_to in the command and it will set up the foreign key for us. Don’t forget to add the relationship macros to the models and validations if needed.</p><p>command: rails g model Mission name scientist:belongs_to planet:belongs_to — no-test-framework</p><p>Once you hit enter you should see the table was created and the model. Next, set up your other models and run rails db:create db:migrate. To run our server we simply run &lt;rails s&gt; in the command line.</p><p>Great, now we have a schema that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*XOM-GNbAJMoONRFEL3vfjg.png" /></figure><p>Now that we have that set up we will create our controllers with this command. Make sure it’s plural!</p><p>command: rails g contoller Missions — no-test-framework</p><p>This will create out controller and now we are able to add our actions in the file. Our actions are methods that will render json data to the server and that’s how we can access the data in our front end using these paths created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*fg0ELlRjiT8QwOlqYvRiOQ.png" /></figure><p>The index action allows us to see all the scientists. Before we can go to the path on local host, we have to add our routes to the routes.rb file. The routes are the only paths that users can access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*iGncMX7zFADr0V6sdQ3RJQ.png" /></figure><p>If you navigate to “/scientists”, you should see our json data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*QspQgJeRWBykIBbmGND7aA.png" /></figure><p>To have control over specifically what information is returned, we can add serializers! For example, we might decide that we don’t need to include the created_at or updated_at attributes in our list. We can also make custom serializers if we want to also include other information and add the serializer name to the specific controller action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*-rmrU0Eqij-8Md6w75SiVA.png" /></figure><p>We create a serializer by running this command(make sure it’s singular):</p><p>command: rails g serializer Mission</p><p>Inside our serializer, we will add the attributes we would like to include in our data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*b0PrdVhkuzhbxmb_VlrAxQ.png" /></figure><p>And there you have it. We created our models/tables, added our attributes and the associations. Then we created our controllers and added our actions. Our last step was creating our serializers to have control over what information was returned.</p><p>Bye!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=332de0d65329" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up a backend API using Active Record]]></title>
            <link>https://medium.com/@evelineguerrero23/setting-up-backend-using-active-record-ee5321a2c96f?source=rss-7209205de899------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee5321a2c96f</guid>
            <dc:creator><![CDATA[Eveline Guerrero]]></dc:creator>
            <pubDate>Wed, 30 Mar 2022 17:01:41 GMT</pubDate>
            <atom:updated>2022-03-30T17:03:14.733Z</atom:updated>
            <content:encoded><![CDATA[<p>Active Record is an ORM which is a programming technique for converting data between incompatible type systems using object oriented programming languages. Active Record migrations use a Ruby DSL (Domain specific language) to generate the necessary SQL so you don’t have to type it by hand. This allows you to keep your schema changes to be database independent.</p><p>It’s a very powerful and flexible way to build web-delivered applications.</p><p>Recently in my coding bootcamp, I embarked on the journey to learn active record. I created a Coffee web app where a user can read about coffee drinks, add a new coffee to the page and even add/delete a comment. This web application was composed of a React frontend and a Sinatra API backend. Below I will show you on how I built my backend using Active record.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*WrNUxF5XjahrpokSsvBQrw.jpeg" /></figure><p>To create a backend api using active record, we have to establish what our relationships will be between the tables using association macros. In this case, I have a one-to-many relationship where comments belong to coffee and coffee has-many comments. Associations set up a connection with another model, such that each instance of the declaring model “belongs to” one instance of the other model.</p><p>First we will have to create our tables using this command:</p><p>bundle exec rake db:create_migration NAME=create_coffee</p><p>This will create a new class called CreateCoffee where we have a create_table method that establishes what attributes our table object is composed of.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q6t93oO3_ln16S8rhITcsA.png" /></figure><p>And now we run run the same command to create a comment table.</p><p>To establish the relationship between these tables we will need to add a foreign key to our Comment table by adding a coffee_id to the comment table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-mbXEP_SOkVaiKvLu75wfw.png" /></figure><p>Next, we will create our ruby class models to connect our associations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*h-CcqVfT8qugLAYp-ugX6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*jtCph07rFo-Rv2tLQvbQ4A.png" /></figure><p>last we will run our migration using this command:</p><p>bundle exec rake db:migrate</p><p>and active record does all the hard work for us!</p><p>We have just created our tables and connected their association! Now we can view our current state of the database schema by clicking on the schema.rb file. This file should always be up to date with your migrations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFcn38iJIvq2d48sxsx7Hw.png" /></figure><p>There you have it on how to setup a backend using Active record.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee5321a2c96f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Search Component in React]]></title>
            <link>https://medium.com/@evelineguerrero23/building-a-search-component-in-react-5849a87cb616?source=rss-7209205de899------2</link>
            <guid isPermaLink="false">https://medium.com/p/5849a87cb616</guid>
            <dc:creator><![CDATA[Eveline Guerrero]]></dc:creator>
            <pubDate>Mon, 31 Jan 2022 03:23:25 GMT</pubDate>
            <atom:updated>2022-01-31T03:23:25.988Z</atom:updated>
            <content:encoded><![CDATA[<p>Just recently I embarked on the journey of learning React and how understanding the Hierarchy of your web app is key to having a structured plan and meeting the end goal of your app. React is a JavaScript library that helps engineers build reusable components and dynamic Web apps. In my most recent project at Flatiron, I built a market web app where a user is able to search for products and the product will appear to the page. Today, I will show you how to build a Search Component in React. Below is an image of my first ever React Web Application!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*znS-vXOygDPd2j0uLfF-nw.png" /></figure><p>Here in the the ProductsPage of the app, I started with setting state for the search to an empty string. Every time setSearch is used, the data will automatically update the state of search. Meaning search will have an updated value, not an empty string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tl0jDtyoBZioiYq0ERcJzg.png" /></figure><p>Next, I declared a displayProducts variable that will filter through a copy of the products and if the products in lower case includes the product searched for in lower case, the page will display the products that matched. We have to change the input typed by the user and the title of product to lower case because computers need to know what exactly to return.</p><p>In the return statement of our ProductsPage function, I am returning the Search Component and passing in the search props to able our search function to use our setSearch and change the current search state.</p><p>Next I built out the Search Component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kQGgSbntAaNqtRx3hR03yw.png" /></figure><p>In the Search function we can see that the parameters are the search state props passed from the ProductsPage. I am returning the div search bar container with an input box where a user is able to input text and our onChange event will update the current state of search to what was typed. The new state is then passed to the displayProducts variable in the ProductsPage component where it will filter through the products and display the products with the matching title. Now ProductsPage will return the whole Search component and update the search as user inputs different searches.</p><p>And that’s how I built a search component in React.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5849a87cb616" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Surviving (a coding bootcamp)]]></title>
            <link>https://medium.com/@evelineguerrero23/surviving-a-coding-bootcamp-e6602469b955?source=rss-7209205de899------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6602469b955</guid>
            <dc:creator><![CDATA[Eveline Guerrero]]></dc:creator>
            <pubDate>Fri, 28 Jan 2022 17:32:57 GMT</pubDate>
            <atom:updated>2022-01-28T17:34:32.354Z</atom:updated>
            <content:encoded><![CDATA[<p>Healthy tips on how to survive through a coding bootcamp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*vG1xalNsMLtt5xA3NfoWOw.jpeg" /></figure><p>Yes, coding bootcamps are no joke. They certainly are not for everyone. Bootcamps are known for their rigorous, condensed and fast paced learning format. I decided to go to Flatiron because I wanted to change careers as fast as possible and it was affordable for me. Now that I know what I have gotten myself into, I thought I’d share a few tips on how to survive a coding bootcamp.</p><p><strong>Prepare</strong></p><p>Preparing mentally, physically and emotionally is key to starting off your journey on the right foot. It will be hard and that’s a fact. Know what you’re getting yourself into and mentally prepare. Don’t get overwhelmed and give up. The best way I handle feeling this way was some words of encouragement. I always tell myself “this isn’t forever” and “it will be worth it”. Remember why you chose to pursue this.</p><p>Set up your study environment. Make sure you have a comfortable work space with minimal distractions. Let the people that are closest to you know that you will be busy and let them know how they can help you succeed.</p><p>Staying positive will be your friend. A journal is a great tool for helping you gather your thoughts, express how you feel and process the emotion. Writing in my journal has helped me significantly with staying motivated and focusing on the end goal. Don’t forget to give yourself a little you time to disconnect your brain and do something you enjoy like taking a bath or hanging out with a friend.</p><p>Activities that help you refocus:</p><ul><li>Stretch/ Yoga</li><li>Meditate</li><li>Breathe</li><li>Take a walk</li></ul><p>Practice <strong>Healthy Habits</strong></p><p>Definitely have a schedule and stick to a routine that best fits you. Make sure you are getting adequate sleep every night to help your body recover from strenuous studying. Eat healthy meals at all meal times of the day. Your brain is working hard so make sure you give it what it needs. Make sure you take your vitamins and eat your proteins to keep your body regulated. Keeping healthy habits are also a way for staying healthy and preventing illness.</p><p>Here in the link below are some optimal foods for your brain:</p><p><a href="https://au.reachout.com/articles/foods-that-help-our-brain-study">Foods that help our brain study</a></p><p><strong>Exercise</strong></p><p>Make sure you exercise! Your body will definitely appreciate it when you have been sitting for days. At times when I have felt overwhelmed or even just needed a break, exercising helped me release stress and tension from my body. I came back to my desk feeling good about working out and refreshed. It’s ok to take breaks and give yourself time to recover.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*_oZmkK13r0ZNkMyL.gif" /></figure><p><strong>Don’t compare yourself</strong> to other cohort mates</p><p>Everyone is different. Yes it’s hard to not compare yourself to other people, but it will help you in the long run. We all work at our own paste and it’s not fair to judge yourself or other people. Focus on yourself and what you need to get done.</p><p><strong>Reward yourself</strong> at the end of every week</p><p>Take time to appreciate all the hard work you have done every week and be proud. Recognizing how hard you have worked each week will help you stay present and appreciate the journey. You can reward yourself by doing something you love. Personally, I love spending time with my friends and partner. They help me relax and wind down at the end of the week.</p><p>This journey is not easy, but it’s definitely worth it. Good luck on your journey and I hope you can use some of these tips to your benefit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*aDyWfLjgSY49BrxF.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6602469b955" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>