H
Harris Reynolds
This happens because you are calling the render method instead of redirect_=
to. Calling render causes the invocation to "render" the new view and the =
new action (method) is never invoked. If you change that to redirect_to it=
will call the action you want.=0A=0AThe net/net is the... render basically=
passed control to the view, redirect_to passes control to the actual actio=
n method.=0A=0Ahope that helps,=0A=0A~harris=0A=0A=0A>First off apologies f=
or a rails question on the ruby list, but the =0A>rails mailing list sign-=
on page seems to be down at the moment so I =0A>thought I would look for h=
elp here.=0A=0ABearing in mind I am very new to Rails... I have a create ac=
tion:=0A=0Adef create=0A @post =3D Post.new(params[ost])=0A if @p=
ost.save=0A @post.tag_with(params[:tag_list])=0A flash[:notice]=
=3D 'Post was successfully created.'=0A redirect_to :action =3D> 'li=
st'=0A else=0A @tag_list =3D params[:tag_list]=0A render :a=
ction =3D> 'new'=0A end=0A end=0A=0Aif the @post.save returns false t=
he user is presented with the new =0Aview again:=0A=0Adef new=0A @tags=
=3D Tag.findall)=0A @post =3D Post.new=0A end=0A=0AOn the initial =
call to new the new view displays a list of tags from =0Athe array @tags. =
If the create action fails and the render :action =3D> =0A'new' line is ex=
ecuted the @tags variable becomes nill=0A=0AHow come this happens? and is t=
here a 'clean' was of keeping the =0A@tags variable as it should be no mat=
ter how many times the create =0Aaction fails??=0A=0AAny help will be grat=
efully received.=0A=0ADavid.=0A=0A=0A =0A__________________________________=
__________________________________________________=0AThe fish are biting. =
=0AGet more visitors on your site using Yahoo! Search Marketing.=0Ahttp://s=
earchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
to. Calling render causes the invocation to "render" the new view and the =
new action (method) is never invoked. If you change that to redirect_to it=
will call the action you want.=0A=0AThe net/net is the... render basically=
passed control to the view, redirect_to passes control to the actual actio=
n method.=0A=0Ahope that helps,=0A=0A~harris=0A=0A=0A>First off apologies f=
or a rails question on the ruby list, but the =0A>rails mailing list sign-=
on page seems to be down at the moment so I =0A>thought I would look for h=
elp here.=0A=0ABearing in mind I am very new to Rails... I have a create ac=
tion:=0A=0Adef create=0A @post =3D Post.new(params[ost])=0A if @p=
ost.save=0A @post.tag_with(params[:tag_list])=0A flash[:notice]=
=3D 'Post was successfully created.'=0A redirect_to :action =3D> 'li=
st'=0A else=0A @tag_list =3D params[:tag_list]=0A render :a=
ction =3D> 'new'=0A end=0A end=0A=0Aif the @post.save returns false t=
he user is presented with the new =0Aview again:=0A=0Adef new=0A @tags=
=3D Tag.findall)=0A @post =3D Post.new=0A end=0A=0AOn the initial =
call to new the new view displays a list of tags from =0Athe array @tags. =
If the create action fails and the render :action =3D> =0A'new' line is ex=
ecuted the @tags variable becomes nill=0A=0AHow come this happens? and is t=
here a 'clean' was of keeping the =0A@tags variable as it should be no mat=
ter how many times the create =0Aaction fails??=0A=0AAny help will be grat=
efully received.=0A=0ADavid.=0A=0A=0A =0A__________________________________=
__________________________________________________=0AThe fish are biting. =
=0AGet more visitors on your site using Yahoo! Search Marketing.=0Ahttp://s=
earchmarketing.yahoo.com/arp/sponsoredsearch_v2.php