Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Advanced Social Features in Ruby on Rails Push Updates Handlebars Helpers

Naomi Freeman
STAFF
Naomi Freeman
Treehouse Guest Teacher

Status id gets lost when I create the handlebar link/helper

It's telling me Couldn't find Status with id=Status

The whole app is working, including the dropdown for activities. Just when I click on the link in the dropdown for activities, suddenly it thinks my statuses don't have ids.

My app has been perfectly functional up until this moment. I've been working on it 8 months and never had it squawk about status id before. Ever.

Thoughts?

https://github.com/summerspirit/laughing-wookie

Error should be in app - controllers - statuses_controller

If I change show, then it tells me on my entire views - statuses - show page that users and gravatars and all kinds of things don't exist.

Please help. Thanks!

3 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Naomi Freeman it looks like your issue is on line 74 of application.js.

Currently it says:

path = Routes.status_path(activity.targetable_type);

Which makes sense that it would send in the "Status" model name. Instead, it should be the id:

path = Routes.status_path(activity.targetable_id);

Hope that helps!

Naomi Freeman
STAFF
Naomi Freeman
Treehouse Guest Teacher

Thanks Jason! I will play with it tonight, see if I can make it go. Just elbow-deep in an open data project atm :) Appreciate you taking the time to come answer this.