Demo Day & Join the FBI?

Day 60 of Flatiron School

Seth

2 minute read

sleeping cat

I’m exhausted tonight. Been working mainly on more Active Record associations. More complex ones than before I would assume to get in practice for later labs. Foreign key and Class Name Active Record class methods to be exact if you’re looking for some light reading lol. I attended an Alumni career fair at my alma matter Belmont University today which was interesting. I never attended one as an undergrad so the whole, drop your resume off on as many tables as possible, was lost on me.

Don't Forget to Check the Password

Day 59 of Flatiron School

Seth

2 minute read

lock on fence

Watching Avi build out the TodoMVC is an interesting thing and I’m happy I get to do it as part of my curriculum and showing what Rails does. That was the bulk of the new work I did tonight. Something that I ran into during my Sinatra project was getting all my associations to work properly. I had issues because of what I now know is called the Active Record Inflector.

Strong Params Can Change

Day 58 of Flatiron School

Seth

1 minute read

sleepy

Not much going on but completing a couple larger labs tonight. One significant things that halted me for a while was an issue in my strong params. I had: def song_params params.permit(:title, :released, :release_year, :artist_name, :genre) end Which looks really nice but doesn’t take into account that I’m using form_for and thus my submitted data is actually a nested hash. A quick change to: def song_params params.require(:song).permit(:title, :released, :release_year, :artist_name, :genre) end Had me moving along again.

The Speaker-Listener Technique

Day 57 of Flatiron School

Seth

2 minute read

minions talking

I can happily say that I got zero, yes 0 coding done today. Well I guess I got a little in during my 45 minutes Sinatra Project review this morning. Which was a great review btw. Hi Seth, Awesome job on your Sinatra Project!! You did a great job, and I really appreciate your work on the Active Record relationships and your clean and concise code. As you move forward these practices will help you a lot.

Life Is Short. Code Hard.

Day 56 of Flatiron School

Seth

2 minute read

life has no ctrl+z

So that intense lab I was talking about yesterday… it took no time at all because of Rails. It was AWESOME. One of the things I learned today that is going to make life easier and ensure DRY.

example_controller.rb # Insert at top of controller before_action :set_example, only: [:show, :edit, :update, :destroy] # Insert at end of controller private def set_example @example = Example.find(params[:id]) end So up until now to access a db object as an instance variable I’ve used the ID passed in from the URL or form and then done a lookup to set the instance variable.