Day 5: Making My Params First

You’re closer than you think to a career in tech. Our grads have launched rewarding new careers — you can too.

View Our Jobs Report

The following is a guest post by Steven Brooks and originally appeared on his blog. Steven is currently a student at The Flatiron School. This is continued from a series on Steven’s pursuit to build his first app. You can follow him on Twitter here.

Although I have had multiple breakthroughs as far as my knowledge has been concerned over the last few days, I am still very stuck. The good news is, I am now beginning to think differently about my forms. Previously, I was worrying about the form first whereas now I am more conceded about creating the params that I want to be given from the form and then making the form first those params that I want. Here are the current params I would like:

Blog post image: tumblr_inline_mqrnbhKtlf1qz4rgp.png

On the above code, I have a routine, which has a name. That routine has this thing called arbitrary which means nothing. But that routine has many lifts, each with an exercise_id and many infos(or sets) which have weight and repetitions.

These are the params I constructed in IRB.

The issue I am now having is that when I choose more than one exercise in my short form:

Blog post image: tumblr_inline_mqrncaqiyW1qz4rgp.png

The params are only showing :lift once. My guess is that it is only picking up the last exercise_id because it is overwriting each lift and just leaving the last one. After about two hours so far today going down a rabbit hole I have decided to post my first question on Stack Overflow. So if anyone can help you can see my first questions here.

Headshot of Flatiron School

Flatiron School

Blog Post Author

Read More Flatiron School Articles

Since we opened our doors in 2012, thousands of students have joined Flatiron School to launch new careers in tech.

Explore our Courses

Find the perfect course for you across our in-person and online programs designed to power your career change.

Explore Our Courses
Join a Community

Connect with students and staff at meetups, lectures, and demos – on campus and online.

Join the Community
Schedule a Chat

Have a question about our programs? Our admissions team is here to help.

Schedule a Chat