# Submit tag takes a parameter to disable the button after it is clicked:
# :disable_with - Value of this parameter will be used as the value for a disabled version
submit_tag ("Submit Me!", :disable_with => "Already submitted!", :id => "submit_button")
# You COULD use javascript to change the caption of the button and re-enable it.
# Or, you can just re-render the button and replace it
render :update do |page|
page.insert_html :top, "result",
render(:partial=>'resultPartial', :collection=> @resultList)
page.replace :submit_button,
:inline => "<%= submit_tag ("Submit Me!", :disable_with => "Already submitted!") %>"
end
# If you're going to do this more than once, make it a partial so you don't have to repeat it over and over
|