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

Ruby Sinatra Wiki search/list pages folder

So i just finished the Sinatra wiki project and I would like to create a page that will list the the pages created with clickable links to each page(textfile) that exists within the pages folder of the project.

I followed the link in the teachers notes about it and it says about using this bit of code to do this

d = Dir.new("testdir") d.each {|x| puts "Got #{x}" }

I kinda get how it works but I dont understand how this fits into the project or where exactly this should be going. Would it be in the main .rb file?

some help understanding and implementing this would be greatly appreciated