-
- 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}
+ if params[:postcode] and not params[:postcode].empty?
+ check_postcode(params[:postcode])
+ elsif params[:query][:postcode] and not params[:query][:postcode].empty?
+ check_postcode(params[:query][:postcode])
+ elsif params[:query][:place_name]
+ redirect_to :controller => 'geocoder', :action => 'results', :params => {:place_name => params[:query][:place_name]}