Rendering an html page, injecting a value of a variable there is different from writing something to console. Putting a p(print/put/printf) statement inside a view file will not do anything, also putting it inside your route/controller will write it to console, rather than browser.
If you run below code and visit http://locahost:4567/hello/15/male/kensington (host and port may differ)
get '/hello/:age/:sex/:location' do
"Hello. I am a #{params[:sex]}. I am #{params[:age]} years old and I live in #{params[:location]}"
end
you'll see a text on browser window sth like,
Hello. I am a male. I am 15 years old and I live in kensington
If you have view files and want to pass some variables to that view,
get '/hello/:age/:sex/:location' do
@age = params[:age]
@sex = params[:sex]
@loc = params[:location]
erb :hello
end
sample hello.erb (let's assume you have such file),
<p>Below table holds some info about King Matt the First</p>
<table>
<tr>
<td>Age</td>
<td>Sex</td>
<td>Location</td>
</tr>
<tr>
<td><%= @age %></td>
<td><%= @sex %></td>
<td><%= @loc %></td>
</tr>
</table>
When you visit localhost:4567/11/male/warsaw
You'll see a page with that content.

When it comes to your code, use combination(2) instead of permutation(2).to_a {|a| a.sort! }.uniq!
2.3.1 :029 > a = [1,2,3].permutation(2).to_a.each {|a| a.sort! }.uniq!
=> [[1, 2], [1, 3], [2, 3]]
2.3.1 :030 > b = [1,2,3].combination(2).to_a
=> [[1, 2], [1, 3], [2, 3]]
Better do not use array as a variable name, but if you insist to use, your code should be written as to print something on browser window..
<div>
<% array.each do |a| %>
<%= Aed.interactions(a[0], a[1]).humanize %>
<% end %>
</div>
http://apidock.com/ruby/ERB
You should also consider to migrate your database queries inside a route/controller block.