Code Hannah

Adventures in Learning Full Stack Web Development

jQuery Front End Project Recap: Static Methods

For this project, I was required to add dynamic features that are possible only through jQuery and a JSON API to my previous Rails app, Socratic. After working through the requirements, I had some class-specific logic that was cluttering my JS files AKA spaghetti code. To clean things up, I moved this logic into the class files by using static methods.

JavaScript Array Methods

JavaScript has data structures called arrays and objects (like hashes in Ruby), and you can operate on these data structures with different methods. There are subtle differences between common methods that might make your head spin if you don’t understand the nitty gritty details.

Rails App: Nested Forms

Keeping track of how things are supposed to work at work is hard. Nobody likes getting asked the same question over and over, especially ones that probably have answers buried in Slack or old emails. Socratic attempts to solve this problem. This app allows users to post questions and allows multiple users to answer one question. If a particular answer turns out to be most useful, the person who asked the question can mark this answer with a green check mark.

Sinatra Project Recap: Bidify

I’m a minimalist, so I’m usually looking for creative ways to get rid of items rather than keep track of them. With that said, for my Sinatra Portfolio Project, I created a CRUD app that keeps track of auction items. I started out by reviewing the MVC framework and building Google sheets to organize my ideas around routes and object relationships.

Struct Your Stuff

The Struct class is a quick way to create a class object without having to write out the initialize method or attribute accessors. Struct should be used when you have a simple object model with a known set of attributes. While arrays and hashes also provide simple ways to structure data, the Struct class offers an opportunity to create cleaner code by encapsulating attributes into a class.