InterviewSolution
Saved Bookmarks
| 1. |
How Do I Get The “route” For The Current Page? |
|
Answer» The REQUEST OBJECT probably has what you’re looking for: GET '/hello-world' do request.path_info # => '/hello-world' request.fullpath # => '/hello-world?foo=bar' request.url # => 'http://example.com/hello-world?foo=bar' end The request object probably has what you’re looking for: get '/hello-world' do request.path_info # => '/hello-world' request.fullpath # => '/hello-world?foo=bar' request.url # => 'http://example.com/hello-world?foo=bar' end |
|