Strong Params Can Change

Not much going on but completing a couple larger labs tonight. One significant thing 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)

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)

Had me moving along again. That’s all I have the energy to type tonight since my 4-month-old had me up at 6am this morning.

Time spent today: 2:38
Time spent total: 216:21
Lessons completed today: 2
Lessons completed total: 445