Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adds the shortcut to the item

  • Loading branch information...
commit 9d32b9370a5d704b92be365059df2e622f1867ee 1 parent 197f695
@chaserx chaserx authored
Showing with 7 additions and 0 deletions.
  1. +5 −0 app/controllers/items_controller.rb
  2. +2 −0  config/routes.rb
View
5 app/controllers/items_controller.rb
@@ -114,4 +114,9 @@ def check_out
redirect_to @item, error: 'Item is not checked in'
end
end
+
+ def go
+ @item = Item.find_by_tag_number!(params[:tag_number])
+ redirect_to @item
+ end
end
View
2  config/routes.rb
@@ -18,6 +18,8 @@
get "pages/privacy"
+ match ':tag_number' => 'items#go'
+
# The priority is based upon order of creation:
# first created -> highest priority.
Please sign in to comment.
Something went wrong with that request. Please try again.