Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

appbites
2,949 PointsTrying to display attachments in all statuses view
So I follow the example in the lesson with displaying the files in Rails (https://teamtreehouse.com/library/programming/advanced-social-features-in-ruby-on-rails/uploading-files/displaying-files)
But it doesn't seem to work when I try to see it in all statuses. I am getting this error:
http://i.imgur.com/uO4eZD7.png
It seems like he cannot recognize "document" method which is called when he go to look for helper in my application helpers.
Why this is happening??
UPDATE#01:
I am adding the code:
app/helpers/application_helper.rb : http://pastebin.com/MpJ4KF4C
app/controllers/statuses_controller.rb : http://pastebin.com/WAcqB51A
app/statuses/index.html.haml : http://pastebin.com/rnWj8vdv
1 Answer

Andy Brown
6,310 PointsShould those statuses be @status
? I'm not sure what you are defining in your controllers without seeing your code.
appbites
2,949 Pointsappbites
2,949 PointsThanks for answer @Andy Brown! Here is the code:
What I am doing wrong here?
Andy Brown
6,310 PointsAndy Brown
6,310 PointsTry to remove the @ from the status variable in your application_helper. That could be the problem.
appbites
2,949 Pointsappbites
2,949 PointsIT WORKS! Thanks @Andy!
Now my question to understand what happened behind the curtain: This status_document_link variable was working fine for creating new status on separate page, why it didn't work for displaying all statuses? :)