Setting up sinatra app to use active record with pagination and search feature