Veterinary RX Aid

Mike Wilder
3 min readJul 21, 2021

When it came time to start working on my Rails project for Flatiron School I was full of enthusiasm but short on inspiration. My previous two projects had dealt with subjects very near and dear to my heart(hockey and wine) and I was having a hard time coming up with a concept which would fulfill the project requirements while also giving me a worthwhile problem to solve. My girlfriend(who works as a practice manager at a veterinary clinic) eventually gave me the idea to build a tool with which pet owners could keep track of their pet’s medications. So that’s what I did.

My first step was to figure out what made a vet/pet/pet owner relationship and how exactly medication figured into that. I established models for Doctors, Pets, Owners, Medication and added a join table for Prescriptions which bring them all together to make it easy for pet owners.

One enduring technical hurdle was getting comfortable with the short hand rails employs. As I got more comfortable using form and link helpers I began to understand why rails is structured the way it is and I started to appreciate the ease these conventions provide to developers. It’s an interesting system which provided a real learning curve after making a Sinatra app but once you get into the flow it really is very helpful.

The darkest period of this project for me was integrating OAuth and allowing users to sign in with their Google account. This relatively simple process turned into a nightmare as I frantically reviewed Flatiron’s labs on the subject and read any tutorial I could get my hands on. Ultimately I did more harm than good and I wasn’t able to fix the problem until I took a solid break, cleared my head and started from scratch following this wonderfully lucid and concise step-by-step guide (https://medium.com/@jenn.leigh.hansen/google-oauth2-for-rails-ba1bcfd1b863). The whole thing turned out to be a valuable learning experience, I learned the value of taking a step back and proceeding with a fresh perspective instead of banging my head against a wall over and over.

Finally, I had a hard time with nested resources. As with the OAuth I reviewed labs I had done and read tutorials but there was just something about the syntax that I found very challenging.

As is so often the case with programming my problem was that I was making it too complicated. I was thinking about how I would remember an attachment between an owner and a pet rather than how Rails might imagine that same attachment. When I remembered that Rails already had the pet’s ID from the URL and the owner’s ID from the current_owner method it was a breeze to put a method together.

Overall it was a more stressful experience than my previous two projects but I think it really engrained some principals which will help me going forward as I try to solve more complex problems.

--

--