model view controller - Delete not working in Rails 3 -
i have app in rails 3 , run crud working except delete link.when click it takes me show action , want delete particular record.below codes
view
index.html.erb:
<td><%= link_to 'destroy', member, :confirm => 'are sure?', :method =>:destroy %></td>
controller
# delete /members/1 # delete /members/1.xml def destroy @member = member.find(params[:id]) @member.destroy respond_to |format| format.html { redirect_to(members_url) } format.xml { head :ok } end end
...any plz..
check javascript libraries. in application had same problem because removed prototype , did not install jquery.
this problem occurs because delete method emulated via javascript.
Comments
Post a Comment