- unless params[:query][:postcode].empty?
- postcode = params[:query][:postcode].upcase
- escaped_postcode = postcode.sub(/\s/,'%20')
+ if params[:postcode]
+ unless params[:postcode].empty?
+ postcode = params[:postcode]
+ check_postcode(postcode)
+ return
+ end
+ end
+ if params[:query][:postcode]
+ unless params[:query][:postcode].empty?
+ postcode =params[:query][:postcode]
+ check_postcode(postcode)
+ return
+ end
+ end
+ if params[:query][:place_name]
+ @place_name = params[:query][:place_name]
+ redirect_to :controller => 'geocoder', :action => 'results', :params => {:place_name => @place_name}
+ end
+ end
+
+ def check_postcode(p)
+
+ @postcode_arr = []
+ postcode = p.upcase
+ escaped_postcode = postcode.sub(/\s/,'%20')