title: How to get current path/route in Sinatra?
body: <p>I'd like to get the current path/route to use in an if statmenent in one of my views.</p>
  
  <p>For example, I'd like to achieve something like this:</p>
  
  <p>example.erb:</p>
  
  <pre><code>&lt;h4&gt;Foobar&lt;h4&gt;
  &lt;p&gt;foo bar foo bar foo bar&lt;/p&gt;
  &lt;% if current_route == /hello %&gt;
    &lt;%= erb :_hello %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>app.rb:</p>
  
  <pre><code>get '/foobar' do
    erb :example
  end
  
  get '/hello' do
    erb :example
  end
  </code></pre>
  
  <p>This way, two routes go to the same view, but if accessed via <code>/hello</code>, it will render an extra partial <code>_hello.erb</code> onto the view.</p>
  
  <p>Is this possible in Sinatra? What's the best way to achieve it?</p>