]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/geocoder_controller.rb
completed UK postcode search
[rails.git] / app / controllers / geocoder_controller.rb
index 99042414d1f24a93241159c72ef78a7cfdf5e493..7d434f19a3b2ec4e9332b0374479d1edbf36c796 100644 (file)
@@ -4,15 +4,12 @@ class GeocoderController < ApplicationController
   require 'net/http'
   require 'rexml/document'
 
-  before_filter :authorize_web
-  before_filter :require_user
-
   def search
     res_hash = {}
     @postcode_arr = []
     @res_ary = []
 
-    if params[:query][:postcode] != "" 
+    if params[:query][:postcode] 
       postcode = params[:query][:postcode]
       if postcode.match(/(^\d{5}$)|(^\d{5}-\d{4}$)/)
         #its a zip code - do something
@@ -42,11 +39,11 @@ class GeocoderController < ApplicationController
           end 
         end
       end
-      redirect_to :controller => 'geocoder', :action => 'results'
+      redirect_to :controller => 'geocoder', :action => 'results', :params => @res_ary
     end
   end
 
   def result
-
+    @res = :params[@res_ary]
   end
 end