Permalink
Browse files

jump to RFC directly when searched for "RFC xyz"

  • Loading branch information...
1 parent c7b7ae0 commit fd07d675d1cf6ac2740c168cd99792e61e82d604 @mislav committed May 16, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 app.rb
View
3 app.rb
@@ -119,8 +119,9 @@ def page_title title = nil
end
get "/search" do
+ @query = params[:q].to_s.strip
+ redirect to('/RFC%04d' % $1.to_i) if @query =~ /^(?:rfc\s*)?(\d+)$/
expires 5 * 60, :public
- @query = params[:q]
@limit = 50
@results = RfcDocument.search @query, page: params[:page], limit: @limit
erb :search

0 comments on commit fd07d67

Please sign in to comment.