<% if params[:uprn] %>

UPRN given:

<%= params[:uprn] %>

<% if @error.present? %> <%= @error %> <% elsif @address_returned.present? %>

Output:

<%= @address_returned.address_line1 %>

<%= @address_returned.address_line2 %>

<%= @address_returned.town_or_city %>

<%= @address_returned.postcode %>

<% end %> <% elsif params[:address] %>

Address given:

<%= params[:address] %>

<% if @error.present? %> <%= @error %> <% elsif @addresses_returned.present? %>

Output:

<% @addresses_returned.each do |address_returned| %>

Address: <%= address_returned.address %>

UPRN: <%= address_returned.uprn %>

Confidence: <%= address_returned.match%> (<%= address_returned.match_description %>)


<% end %> <% end %> <% end %>