Your form is doing a HTTP GET
<form action="/search" method="get">
but your Sinatra action is defined to receive HTTP POST requests.
post '/search' do
I think what is confusing you is that you have a class named Post. The get and post in the actions are not class names, but REST actions. Review routing.