• Fixed railscast #103 Site-Wide Announcements Object of announcement showing up along with announcement

    Hi there, I recently fixed a problem where the object of an announcement was being printed along with the announcement message itself.

    So I recently solved a really silly mistake in Rails. I'm quite new, but I thought I'd share this "gotcha" in case I forget or others run into this trouble.

    I have been adding a few features to one of my apps following Railscast #103 Site-Wide Announcements (revised). 

     

    At the time here is what I was looking at: 

    Fixed railscast  #103 Site-Wide Announcements Object of announcement showing up along with announcement

     

    All this garbage below my nice site announcements! What gives? Why is each object printing out below the announcement?

    Here is a look at my code, see if you can spot my typo

    Fixed railscast  #103 Site-Wide Announcements Object of announcement showing up along with announcement (2)

     

     

    Just one little extra typo in the announcement loop, d'oh. But the fix is quick as you'll see . . .

    Fixed railscast  #103 Site-Wide Announcements Object of announcement showing up along with announcement (3)

    And just like that voila. No more object garbage and just my announcement.message

     

    Fixed railscast  #103 Site-Wide Announcements Object of announcement showing up along with announcement (4)

    (note, looks suspiciously like I photoshopped it out, but that white mark is just the top of the main graphic . . bad monosnap skills)

    That makes me happy, and the tests are passing =]

     

     

    1-min read. About as long as a Coldplay key change takes to ruin a song.

    Follow the cult

    New track posted most days. Pick your channel.

    78 weirdos already on the list
    📼 From the vault
    ARE WE DREAMING & Brian Tyler - Godlike
    Sep 2026 — You’ve heard Brian Tyler’s music whether you know his name or not; the man has scored Fast & Furious sequels and half the Marvel B-team, and...
  • ← Next Post Previous Post →
  • Leave a comment