I have the following code that will be repeated many times in a single .rthml page.
<%=link_to_remote("Test AJAX", :update => 'chart', :url => url_for(:controller => 'chart', :action => 'linear_graph'), :loading => "Element.show('loading'); ", :complete => "Element.hide('loading')", :before => "this.parentNode.className = 'myclass';") %>
What is the best way to DRY this up so the :loading, :complete:, :before: and :update callbacks are reused? I want to avoid changing all instances of this call when I update the code. The only parameter that will change is :url