# Redirect link is not working

**URL:** <https://www.ruby-forum.com/t/redirect-link-is-not-working/111494>\
**Category:** Rails\
**Created:** [August 7, 2007, 10:54pm UTC](https://www.ruby-forum.com/t/redirect-link-is-not-working/111494 "2007-08-07T22:54:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ajit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a3d4f5/32.png) [@Ajit](https://www.ruby-forum.com/u/Ajit)\
**Post date:** [August 7, 2007, 10:54pm UTC](https://www.ruby-forum.com/t/redirect-link-is-not-working/111494/1 "2007-08-07T22:54:04Z")

</div>

# index.rhtml \<%= form\_tag %\> select category : \<%= select ‘treatmentphase’, ‘cats’ , Treatmentcategories.find(:all).collect {|l|[l.name, l.id]}%\> phase : \<%= text\_field ‘treatmentphase’, ‘phase’%\> Comments : \<%= text\_area ‘treatmentphase’,‘comments’%\> \<%= submit\_to\_remote ‘button’, ‘Save’, :url =\> {:action =\> ‘savephase’} %\> \<%= submit\_to\_remote ‘button’, ‘Save & More’, :url =\> {:action =\> ‘saveandmore’} %\> \<%= end\_form\_tag%\>

controler:

def savephase #used to save the pahse item  
@treatmentphase = Treatmentphases.new()  
@treatmentphase.name = params[:treatmentphase][‘phase’]  
@treatmentphase.description = params[:treatmentphase]  
[‘comments’]  
@treatmentphase.treatmentcategory\_id = params[:treatmentphase]  
[‘cats’]  
@treatmentphase.user\_id = session[:user]  
if @treatmentphase.save

```
      redirect_to :controller => 'treatmentcategories',:action =>

```

‘index’  
else  
render :action =\> ‘savephase’  
end  
end

it is saving the data but not redirecting to the controller. any  
suggestions?
