<% if button_type == :text -%> <%= link_to_remote( button_text, :url => activity_path(activity, :format => 'js'), :method => :delete) %> <% else -%> <% remote_form_for(:activity, :url => activity_path(activity, :format => 'js'), :html => { :class => "delete-form activity-delete", :method => :delete } ) do |f| -%> <% if button_type == :image -%> <%= image_submit_tag '/images/icons/delete.png', {:title => button_text, :width => '15', :height => '15', :alt => button_text } %> <% else -%> <%= submit_tag button_text, { :title => button_text } %> <% end -%> <% end -%> <% end -%>