Explain

<%= form_tag explain_path do %> <%= text_area_tag :query, @query, placeholder: "Enter a SQL query" %>

<%= submit_tag "Explain", class: "btn btn-info" %>

<% end %> <% if @explanation %>
<%= @explanation %>

<%= link_to "See how to interpret this", "http://www.postgresql.org/docs/current/static/using-explain.html", target: "_blank" %>

<% elsif @error %>
<%= @error %>
<% end %>