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! While you're at it, check out some resources Treehouse students have shared here.

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

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.

Justin Whedon
Justin Whedon
19,811 Points

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