Solace Enwere
Solace Enwere
15,102 Points

Building Web Apps with Sinatra - Loading Text Files

Hello, I'm currently following the url parameters video and I pass the title to page_content like this

require "sinatra"

set :bind, ""

def page_content(title)"pages/#{title}.txt")
rescue Errno::ENOENT
  return nil

get "/" do
  erb :welcome

get "/:title" do

So in workspace, when I save and run ruby wiki.rb then link up to the 4567 port and then /Nick Pettit; it's supposed to show the contents of Nick Pettit path riight? (with the Nick Pettit.txt file) but for me it just loads to a blank page. But when I do the same the for /Amit Bijlani it then shows me the the contents of Amit Bijlani.txt

I've reloaded the workspace and everything... any ideas why /Nick Pettit isn't visible but /Amit Bijlani is.