// routes.rb
get 'dev/form'
post 'dev/form'
// form.html.erb
<%= form_tag(dev_form_path, method: "post") do %>
<%= label_tag(:q, "Search for:") %>
<%= text_field_tag(:q) %>
<%= submit_tag("Search") %>
<% end %>
<%= params[:q] %>
form.html.erb is POSTing to form.html.erb itself.
With this, the single page application is complete.
Since we only write this much and only use two files, it's easy to manage, right.