# Redirect issue

**URL:** <https://www.ruby-forum.com/t/redirect-issue/184415>\
**Category:** Rails\
**Created:** [March 2, 2010, 5:32am UTC](https://www.ruby-forum.com/t/redirect-issue/184415 "2010-03-02T05:32:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin\_mercy2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Post date:** [March 2, 2010, 5:32am UTC](https://www.ruby-forum.com/t/redirect-issue/184415/1 "2010-03-02T05:32:02Z")

</div>

Dear Friendz,

I have found a unique issue. This is the first time iam getting a issue  
like this. I have created a add, delete page. after adding or deleting  
functionality it should redirect to list page. Everything was working  
fine for last two months suddenly from yetserday the page was not  
redirected properly to list page after add or delete. That too it works  
fine in firefox but doesnt redirect in IE.

Could anyone please suggest on this issue.

Code:

def delete\_company  
#------------  
if params[:id] and params[:id1]  
@policy = PolicySetting.find\_by\_id(params[:id])  
@policyinfo = PolicySetting.find\_by\_id(params[:id1])  
@policy\_name = @policy.policy\_name  
if !(@policyinfo.nil?)  
@policy\_count = PolicySetting.find(:all, :conditions =\>  
{:policy\_name =\> @policy\_name, :policy\_type =\>  
‘C’})  
if @policy\_count.length \> 1  
if params[:id].to\_i == params[:id1].to\_i  
if @policyinfo.destroy  
@policy = PolicySetting.find(:first, :conditions =\>  
{:policy\_name =\> @policy\_name, :policy\_type  
=\> ‘C’})  
flash[:notice] = “Selected company has been successfully  
removed”  
redirect\_to :controller =\> ‘policies’, :action =\>  
‘companies’,  
:id =\> @policy.id  
end  
else  
if @policyinfo.destroy  
flash[:notice] = “Selected company has been  
successfully  
removed”  
redirect\_to :controller =\> ‘policies’, :action =\>  
‘companies’, :id =\> params[:id]  
end  
end  
end

```
  else

    flash[:error] ="Selected company has been alredy deleted"

    redirect_to :controller => 'policies', :action => 'companies',

```

:id =\> params[:id]

```
  end
end

```

end

Thanks in advance

Regards,  
Jose Martin

---

<div class="post-metadata">

**Author:** ![martin\_mercy2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Post date:** [March 2, 2010, 8:11am UTC](https://www.ruby-forum.com/t/redirect-issue/184415/2 "2010-03-02T08:11:43Z")

</div>

could anyone have suggestions on why its so? and any possible solution.

Also in IE too when proxy settings were applied it works fine and when  
proxy is not applied it shows HTTP 400 error after redirect\_to method

Regards,  
Jose
