Download box opens when i click submit

I need to enter a note for a user. I have clicked the link to Make note.
It actually calls a partial page which disables and overwrites the
current window with a new small window. In that i will enter the note
for a user and click Create Note button. When i submit, a download file
appears which has my .js.erb file contents.

To redirect the page i have used .js.erb file and a js function in
ddv.js.

Have anyone come across this situation. Please help me out.

Thanks in Advance.

Attachments:
http://www.ruby-forum.com/attachment/5914/notes.JPG

can you share some code? the controller action and the js.erb file contents.