Going off the Rails…Time 2 Panic?

Michael Rivera
3 min readJun 4, 2021

--

Rails is a powerful web application framework rooted in the Ruby programming language. High profile apps such as Airbnb, Basecamp, Github, Kickstarter, and Chowhound — to name a few — were built using Rails.

This framework prides itself on its convention over configuration philosophy, which the community believes leads to more a effective, efficient, and fun web application development process. Strict adherence to this core tenet creates an almost ‘magical’ feeling when programming Rails…so much so that ‘Rails Magic’ has become a common way to describe many of the Rails processes (at least for us beginners). The magic of Rails is both a blessing and a curse. You can read more about demystifying the magic of Rails here.

Focusing on the positive (a critical habit to making it through the Flatiron curriculum), ‘Rails Magic’ provides users with many powerful tools and tricks. One of these powerful tools are the Rails ‘Generators’ — scripts that generate various files (e.g. models and controllers) that will form the foundation of your web application. More can be learned about Rails Generators here.

This is where we’ll start going off the rails…

Coffee Stains and Chicken Scratch is the start of every great project

The premise of my phase three project was a basic community fitness application that focused on three main models, necessary join models, and their various associations: Users, Workouts, Exercises.

The main associations utilized a variety of has_many, belongs_to, has_many through, and many-to-many. Learn more about associations here.

The application also utilizes forms, which really is what powers the majority of applications. The collection, cleaning, and curation of data that flows into our program. Class methods and Customer setter methods such as the ones above allow for greater controller and manipulation of the various model associations.

Drawing the routes for this project was an improvement over the sinatra routes. However, it mainly follows the same logic. A combination between resources, nested resources, and custom routes enhances the application’s power to efficiently and securely direct users through the app’s experience.

The user experience flows as such:

  1. User visits our site
  2. User Registers / Logins (directly or via OmniAuth — an awesome 3rd party Standardized Multi-Provider Authentication library. Try saying that three times fast.)
  3. Users create workouts by associated existing community exercises or associating custom exercises created by the users

If you’d like to give it a go please check out my github!

--

--

Michael Rivera
0 Followers

So many things to learn so little time. Stay curious!