close popup window?

I'm new to ruby, and I'm tweaking a plugin. Can you show me how I
would close a window upon clicking a submit button? Here's the code
on the xhtml page: <%= submit_tag "Save" %>

And the code on the controller.rb page: redirect_to params.slice
(:filter, :sort_by, :key_type, :key_pattern, :text_type, :text_pattern).merge
({:action => :index})

As I stated, I would like this last line to close instead of
redirecting to index. Thanks!

You'll need some javascript to accomplish that. for an ajax form you
could simply use the appropriate callbacks, for a non ajax form I
suppose you could redirect to or a render a page which just had a
small fragment of javascript that said window.close()