# IE7 and restful delete links broken?

**URL:** <https://www.ruby-forum.com/t/ie7-and-restful-delete-links-broken/116721>\
**Category:** Rails\
**Created:** [October 9, 2007, 12:10am UTC](https://www.ruby-forum.com/t/ie7-and-restful-delete-links-broken/116721 "2007-10-09T00:10:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [October 9, 2007, 12:10am UTC](https://www.ruby-forum.com/t/ie7-and-restful-delete-links-broken/116721/1 "2007-10-09T00:10:56Z")

</div>

My restful delete links work in everything except IE7, in which case the  
delete works, but then it redirects back to the ‘href’ that was on the  
delete link. I’ve even tested this with regular restful scaffold and i  
still get the same behavior.

Link RHTML:  
\<%= link\_to(image\_tag(“delete.png”, :border=\>0, :alt=\>“Delete List”),  
{:controller =\> ‘lists’, :action=\>‘destroy’, :id=\>@list},  
{:confirm=\>‘Are you sure you want to delete this list?’,  
:method=\>“delete”}) %\>

Link Output:  
[![Delete List](https://www.ruby-forum.com/images/delete.png?1189326914)](https://www.ruby-forum.com/lists/22)

Destroy Method:

# DELETE /lists/1

# DELETE /lists/1.xml

def destroy  
@list = List.find(params[:id])  
@list.destroy

```
respond_to do |format|
  flash[:notice] = "List <strong>#{@list.name}</strong> was

```

successfully deleted."  
format.html { redirect\_to lists\_path }  
format.xml { head :ok }  
end  
end

Routes:  
map.resources :lists,:member=\>{:print=\>:get}, :collection =\> {:order =\>  
:put} do |list|  
list.resources :categories, :collection =\> {:order =\> :put} do  
|category|  
category.resources :items, :collection =\> {:order =\> :put}  
end  
end

When you click delete, it runs through destroy, destroys the list, and  
then instead of redirecting to lists\_path, it redirects to /lists/[id]  
which is the href on the delete link. This behavior is ONLY in IE7. IE6  
works fine, as do firefox and safari.
