views:

48

answers:

1

I have this code in the view for delete button

<%= form_tag(recource_item_path, :method => :delete) do %>
  <%= submit_tag('Delete', :class => 'delete') %>
<% end %>

I want to move it into the helper.

def delete_tag(path, name = 'Delete')
  form_tag(path, :method => :delete) do
    submit_tag(name, :class => 'delete')
  end
end

But it just returns form tag stuff without the button inside.

(I'm running Rails 3 RC.)

UPD: Just failed to reproduce it in new application. Seems like a local problem.

A: 

Not sure if this will actually help, but this ASCIIcast episode has information on the new way that ERB blocks work, and it has a section on form helpers.

Topher Fangio