Permalink
Browse files

Add 4-5 character namespaces

  • Loading branch information...
1 parent bdb2227 commit d62fa62e2be44f7ef89f12e8b57970bbb73a49d8 @scollett committed Mar 4, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 app/controllers/search_controller.rb
  2. +1 −1 config/routes.rb
@@ -8,7 +8,7 @@ def new
end
def run
- item = /([a-z]|[0-9])+\.\$*([a-z]|[A-Z]|[0-9])+/
+ item = /([a-z]|[0-9])+\.\$*([a-z]|[A-Z]|[0-9]|\/|\:|\$)+/
record = /(^oclc\:)|(^lccn\:)|(^isbn\:)|(^issn\:)|(^sysid\:)/
if(item.match(params[:id].downcase))
# with a item htid go direct to item page
View
@@ -5,7 +5,7 @@
ActionController::Routing::Routes.draw do |map|
# Items route: Custom restful action for showing Hathi Trust item.
- map.connect 'items/:id', :controller => 'items', :action => 'show', :id => /([a-z]|[0-9]){3}\.\$*([a-z]|[A-Z]|[0-9]|\/|\:)+/, :method => :get
+ map.connect 'items/:id', :controller => 'items', :action => 'show', :id => /([a-z]|[0-9]){3,5}\.([a-z]|[A-Z]|[0-9]|\/|\:|\$)+/, :method => :get
map.connect 'records/:id.:format', :controller => 'records', :action => 'show', :method => :get
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.

0 comments on commit d62fa62

Please sign in to comment.