public
Description: Your favorite URL-shortening service in all of Ruby land
Homepage: http://rubyurl.com
Clone URL: git://github.com/robbyrussell/rubyurl.git
Search Repo:
Removed redirect controller, moved action to links controller

git-svn-id: https://svn.roundhaus.com/planetargon/rubyurl_2-0/trunk@27 
f0bc2f90-cf15-dc11-b192-0016e6374d05
robbyrussell (author)
Mon Jul 16 18:28:27 -0700 2007
commit  7577a8b2e74a8c06c22ade1ba1325a31530b38b3
tree    7bc22fe201a0e7ac276330bfcb36e092d6418f9c
parent  72212924a890a29fdbeb2485c7863b4a2adcec9f
...
7
8
9
 
10
11
12
...
7
8
9
10
11
12
13
0
@@ -7,6 +7,7 @@ class ApplicationController < ActionController::Base
0
   
0
   before_filter :calculate_links
0
   
0
+ # refactor to some sort of cache tool
0
   def calculate_links
0
     @cached_data = {:link_count => Link.count}
0
   end
...
15
16
17
 
 
 
 
 
 
 
 
 
 
 
18
...
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
0
@@ -15,4 +15,15 @@ class LinksController < ApplicationController
0
   def invalid
0
     
0
   end
0
+
0
+ def redirect
0
+ @link = Link.find_by_token( params[:token] )
0
+
0
+ unless @link.nil?
0
+ @link.add_visit(request)
0
+ redirect_to @link.website_url
0
+ else
0
+ redirect_to :controller => 'links', :action => 'invalid'
0
+ end
0
+ end
0
 end

Comments

    No one has commented yet.