Browse files

Link#show increments visits

  • Loading branch information...
1 parent 434e382 commit eaea3ae8a494dfa7befb3b6d58a69cfe28f49e59 @nmanzi committed Oct 7, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 app/controllers/links_controller.rb
View
3 app/controllers/links_controller.rb
@@ -15,7 +15,8 @@ def index
# GET /links/1.json
def show
link = Link.find_by_subdomain!(request.subdomain)
-
+ link.visits += 1
+ link.save
redirect_to link.url
end

0 comments on commit eaea3ae

Please sign in to comment.