Ruby Rails Project

Sean Ransonette
2 min readDec 24, 2020

Admittedly, this project was much harder than I was expecting. Learning how to set routes and use _path correctly stumped me in the beginning. Once it made more sense, I can definitely see why it is so effective. I enjoyed having to refactor my app using helper methods. They refine the methods in my controllers by making them look clean and readable.

My Pokémon Rails project allows the user to sign up, log in, log out, and has password capabilities using bcrypt. It has 3 models: Trainer, which is just the user’s page named to match the theme then Belt model, which is the join table and Pokémon. The trainer has many belts and has many Pokémon through belts. Belt belongs to trainer and belongs to Pokémon. Lastly, Pokémon has many belts and has many trainers though belts.

Using join form was a significant struggle for me in this project. In the end, I got it to function in the necessary way by allowing the user to create a belt and Pokémon simultaneously. The belt automatically gets associated to the trainer since the trainer ID is already in the URL with params and then I create the belt with Pokémon associating the two.

The user has full CRUD in the app. Creation of belts and Pokémon. You can delete any belts or Pokémon and choose to update both at the same time or separately. The user’s belts are shown in the index page with the Pokémon attached underneath. Pokémon can be named and given a Pokémon type. Types including: fire, water, electric, etc. Belts have a belt name and a tier. I want to have a ranking for how powerful the Pokémon attached to the belt is for organizational purposes.

The final exciting thing I learned to use was the scope method. Within my belt model I have a scope method that uses .order and .limit(5) to show the top 5 ranked belts that the user has created. I have it on the trainers show page so that when they log in the always see their top 5 best belts.

As challenging as this project has been, I appreciate the extensive learning opportunities and functional training rails has given me. I look forward to moving forward and learning more about JavaScript.

--

--