You should move the code for the post
out to another action that can handle that.
post '/', :to => "index#submit"
Then you can define a submit
action within your IndexController
to handle the form, and the index
action won't run the form code anymore.