You can use a remote form + partials, and js.rjs file will refresh the table in main window.
It seems it looks like this getting started example mixed with this ajax mini-tutorial example, both from Rails Guides.
note this, from Working with javascript:
<b>Users</b>
<ul id="users">
<% @users.each do |user| %>
<%= render user %>
<% end %>
</ul>
<br>
<%= form_for(@user, remote: true) do |f| %>
<%= f.label :name %><br>
<%= f.text_field :name %>
<%= f.submit %>
<% end %>