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 Rails Routes and Resources A Route to a Read Action Finding a Page

MaryAnn Eleanya
MaryAnn Eleanya
8,626 Points

page body isn't showing.

https://teamtreehouse.com/library/finding-a-page

In the video above, I was able to get the title whenever I clicked on the individual pages but for some reason the body text is not showing.

<h1><%= @page.title %></h1>

<p>
    <%= @page.body %>
</p>

2 Answers

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

Maybe body is just returning nil or an empty string for this Page object. What do you see if you change @page.body to @page.body.inspect?

Or, you might try going into the Rails console, typing Page.find(this_pages_id_number).body and see what you get there. If you get an error, please copy-paste it into this thread.

I'm getting same issue... nothing shows .