I have the following scaffold generated code which does not run. It does
even hit the breakpoint.
@student = Student.new(params[:student])
flash[:notice] = ‘Student was successfully created.’
redirect_to :action => ‘list’
render :action => ‘new’
I decided to run functional test on the controller. Here is the result:
Expected response to be a <:redirect>, but was <200>
Also from another action I get the following error:
is not true.
I don’t undertand why this code fails and what the failure means.
Can someone also please explain when to use redirect_to vs. render?
for your help.