forms - Rails 3 form_for helper not submitting action correctly -


i have form:

<% @page_title = "delete technician: #{@technician.name}" %>    <%= link_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}) |f| %>  <p>are sure want permanently delete technician?</p>  <p class="reference-name"><%= @technician.name %></p>  <div class="form-buttons">   <%= submit_tag("delete technician") %> </div>  <% end %> </div>   

when click on submit button url get:
www.site.com/technicians/1

instead of
www.site.com/technicians/destroy/1

am not using form_for helper correctly or configuration somewhere?

you're making more complicated needs be. there no reason form when link or button do. why not this

<p>are sure want permanently delete technician</p> <div> <%= link_to "delete", technician_path(@technician), :method => :delete %> </div> 

that's it.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -