I have this form:
<% @page_title = "Delete Technician: #{@technician.name}" %>
<%= link_to("<< Back to List", {:action => 'list', :id => @technician.id}, :class => 'back-link') %>
<div class="technician delete">
<h2>Delete Technician</h2>
<%= form_for(:technician, :url => {:action => 'destroy', :id => @technician.id}) do |f| %>
<p>Are you sure you want to permanently delete this technician?</p>
<p class="reference-name"><%= @technician.name %></p>
<div class="form-buttons">
<%= submit_tag("Delete Technician") %>
</div>
<% end %>
</div>
when I click on the submit button this is the url that I get:
http://www.site.com/technicians/1
instead of
http://www.site.com/technicians/destroy/1
am I not using the form_for helper correctly or is it a configuration somewhere?
You’re making this more complicated than it needs to be. There is no reason for a form when a link or a button would do. Why not just this
That’s it.