PDX Dance Classes App

Milan Page
4 min readJun 24, 2021

Sinatra Content Management System App

Was at first very scary! Until I trusted the structure of everything and decided to relinquish control to how everything seamlessly worked together if you just let it (if you use the right code, and stop adding unnecessary code). I’m not sure if that even makes sense, but through my thought process that’s how I felt. I’m still in awe at how all the systems worked together. I was so afraid I wasn’t going to understand it at first, but with a little patience and trust we got our App working!!!

PDX Dance Classes App

The “PDX Dance Class App” was created to link all of the Portland dance community together through new classes, master classes, pop up classes, battles, sessions, and regular weekly classes! You can “Sing Up”, create “Dance Classes” of your own, and view “Dance Classes” previously created by other users. You can also view what Studios are located in the Portland area and associate your “Dance Classes” with a particular studio when you create them. Theres no wrong way to use this app, you just have to be clear to explain details about the class/classes you want to share with the community!

Thought Process behind the App

I’ve been dancing most of my life and grew up taking dance classes like a religion, everyday of every week. As I got older I started to branch out of my hometown studio in Portland and try out other studios in the area that held Advanced classes for adult dancers as well. This included things like freestyle sessions my friends would tell me about, master classes held by dancers from out of town, freestyle battles, and even just weekly regular classes held at the same studio every week. All of these examples of a dance class had to be held at a dance studio in the Portland area to make the event actually happen. Sometimes an event would be so last minute that unless you knew someone who knew about the class you would end up missing the entire event plus the opportunity to make that potential dance connection(like if it was big name choreographer/dancer).

In a town like Portland, our dance community isn’t as big as or exactly like LA or New York, but there are still tons of underground events and classes that go on that so many dancers don’t know about. So… how do we make all these events available to everyone in the Portland dance community? We create an App about them!

Active Record Associations

I want to talk about the Active Record relationships inside my PDX Dance Classes app. I decided to use a “has-many, has-many-through, and belongs-to” relationship with my objects. First I’m just going to be completely honest and tell you that Active Record Associations really through me off at first. For some reason I felt like my brain just wouldn’t fully grasp the idea of all these relationships and how they worked together. So since I started this project my mission was to genuinely understand these relationships with more confidence.

Active Record Associations make working with our Objects easier, faster, and even neater. It allows us to associate our Models and our database tables! Best part about it is you don’t have to right a crap ton of code anymore!

Has-many/Belongs-to”

In my project I started out with one “has-many/belongs-to” relationship, between the User(Dancer) and it’s “Dance Classes”. I soon realized I could do so much more with my Dance Classes if I associated Studios through an Active Record relationship instead of keeping it as a simple Column inside my Dance Classes Database. This gave me access to so much more and allowed me to create a separate page for individual Dance Studios as well. Giving the User more resources and making my job way easier! Then the relationship through “Styles” came into mind and I again realized that every dance class has a specific style and it would be way easier to access all these styles if I created another Association/Class just for them. So now my Dance Classes “Belong-to” a specific style and a specific studio!

Has-many through”

But wait how do I connect the relationship between “Studios” and “Styles”? That’s when “Has-many through” came to mind and I was like wow I guess I do know what I’m doing… So I added the relationship between Studios and Styles and I then had even more access to super cool code just because of Active Record Associations.

Conclusion

Active Record Associations is pretty freaking cool once you figure out how it works on your own. I highly recommend just creating a practice App to witness how many methods, and cool things are attached to it. I could talk about it all for a long time because there are hundreds of awesome methods!

--

--