Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Link#show increments visits

  • Loading branch information...
commit eaea3ae8a494dfa7befb3b6d58a69cfe28f49e59 1 parent 434e382
@nmanzi authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.