Paloma's Code


Software Developer loving the challenge!

Ruby on Rails!

This time around was much more challenging for me, in particular the associations, but we’ll get to that in a second. Firstly I wanted to say that the magic of Rails is real and humbling. The months leading up to this project had us diving into the foundations of it all and made me see only a fraction of the powerhouse that is Rails. There were gems out there too but I decided to start this project off of Rails and the basic gems like bcrypt and omniauth.
I decided to base my project on the idea that my local church gave me, a Sunday School app. This app would let teachers keep their assignments, classroom, parent contact information and student info all in one place. There’s no need for a gradebook but they do wanted their assignemnts marked complete for each student.
As I mentioned before, the associations really threw me for a loop. Most specifically, the has_and_belongs_to_many association. While I did have my models with appropriate associations, the bigger picture didn’t fit within it and I had to switch over to the has_many :through association as a result. I’ll put a snippet of code below to explain that transition.

class Assignment < ApplicationRecord
    belongs_to :teacher
		has_many_and_belongs_to :children
end


class Child < ApplicationRecord
    belongs_to :classroom
		has_and_belongs_to_many :assignments
end


This should have worked for me and let me assign as many assignments to as many children as I wanted, but the naming did not let me. The plurality of ‘children’ threw me completely off throughout my project and stalled me almost completely. Had it not been for the Rails guide I really would have had to start over 3 days into the project. I was able to get everything in order by doing the following: (If you plan on following suit, I strongly suggest doing this in order

  1. Delete the Assignments and Children tables, doing a has_and_belongs_to_many requires you to make a join table whose sole purpose is to carry the foreign keys without having an id itself.
  2. Create a join table with an id and belongs_to datatypes for the respective models’ foreign keys
  3. Review and edit your model’s associations to reflect a has_many :through association instead, making sure to include the new join table as your :through relationship


Sinatra Project

SINATRA! A library built in Ruby - for Ruby. This neat gem lets us program on Ruby much easier than without. Building this project from scratch was much more rewarding than the first project we did at Flatiron. I was able to work more closely with HTML formatting and CSS styling. The example webapp that is used to confirm that corneal was successfully installed and is functioning correctly also gave me a look inside its web design with HTML and CSS.
I decided to go with a Bills App for this project becuase I do see organization as a great tool that could be used by anyone, likewise I wanted to make it user friendly. I got started by doing the following:

  1. Install Corneal gem
  2. Use 'corneal scaffold NAME' to create entire mvc structures with migration files
  3. Configure models to have proper associations and validations
  4. Create tables with 'rake db:create_migration NAME=table_name'


With the foundation of the app complete, I was able to move on and start working on my routes. This is where consideration for the user experience comes into play for me. Personally, I like visuals and readable figures so my dates, balances and navigation had to be the most-user friendly I could create. I found a <a href=https://www.educative.io/edpresso/how-to-create-columns-in-html>site</a> that would then let me create columns in HTML to be able to include a menu for navigation.
The next aspect I wanted to make sure was legible was the date, so I changed the datatype of my balance columns in my bills table within my migration folder to ‘decimals’ and formatted the output in my views folders to show two decimal places:

<li>Amount Due: <mark>$<%= "%.2f" % @bill.amount_due %></mark>

CLI Project

I got through it! I got it to work! - These were my first thoughts whenever I first got my CLI project to work and it felt incredible, knowing that I was able to implement the things I’ve been learning for the past few weeks into a personalized project with functionality was honestly one of the proudest moments of my life, there was nothing to bring my mood down since then. For those of you just starting the project out, please don’t ovethink your solutions, there are many resources online that help you understand methods like scraping or looping if you haven’t fully grasped those yet, and many others. Starting this project with a clear idea of what I wanted the app to do was key to getting the ball rolling and getting everything in its place. Scraping was challenging at first but once you grasp the concept and retrieval proceedures you can definitely get it done and this experience will help in a long run as well. I HIGHLY recommend testing out your code as you go, I personally used the REPL.it site to verify that my scraping was on the right track and I used PRY to make sure my code was okay. The project was a very rewarding experience and while it was nerve wrecking at first, I was proud of my end result! All in all, my project focused on the user’s experience. I knew what my information my user needed to see and planned my paths accordingly. My app, Anime 2020, first welcomes the user then prompts the user to input ‘2020’ to display all anime premiering in 2020. Once the user enters ‘2020’, this app shows the list of anime. Once the user chooses an anime from the list, they can input the reference # which then prompts the app to display a description and release date for that anime. The user can then choose to see the list again or quit the application. Visually, the user will see the following promtps:

  1. Welcome message
  2. Please enter ‘2020’ to see all 2020 anime => (Displays anime list)
  3. Please choose an anime by number to see more info about that anime=> (Displays anime name, description, release date)
  4. Enter ‘back’ to see the list again or enter ‘exit’ to quit the app
  5. Goodbye message

Why I Changed My Career Path

I was previously working in a logistics firm located in uptown Dallas when I came accross a video on the internet. It showed a Flatiron Alumni from California who shared the aftermath of her hard work and dedication while studying at Flatiron. Completely unscripted as it was, I found that video by chance on TikTok! Her journey piqued my curiousity so I followed her on TikTok and YouTube as she had other videos further describing her experience and her current employment opportunities. Thinking that someone could ever decide to change their carreers because of a 15 second internet video is almost preposterous but, it happened!