You could store the commands in an rjs template and keep it in a shared
directory. Another idea is to give all of these fields a css class name
that is the same the use the select prototype call to do it in one fell
swoop using a collection proxy:
render :update do |page|
page.select(’.notice_fields’).each do {|f| f.replace_html ‘’}
end
As long as all of the elements have class=“notice_fields” you are good
to go. Note that it can be any one of a number of classes for those
elements or any other valid css selector.