index.rhtml
<%= form_tag %>
select category : <%= select ''treatmentphase'',
''cats'' ,
Treatmentcategories.find(:all).collect {|l|[l.name, l.id ]}%><br/>
phase : <%= text_field ''treatmentphase'',
''phase''%><br>
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?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---