Por que: aviso não aparece após o redirecionamento no Rails 3
Eu tenho o seguinte código no meu controlador
def create
@tv_show = TvShow.new(params[:tv_show])
respond_to do |format|
if @tv_show.save
format.html { redirect_to(tv_shows_path, :notice => 'Tv show was successfully created.') }
format.xml { render :xml => @tv_show, :status =,> :created, :location => @tv_show }
else
format.html { render :action => "new" }
format.xml { render :xml => @tv_show.errors, :status => :unprocessable_entity }
end
end
end
e o seguinte em meus tv_shows / index.html.erb
<div id="notice"><%= notice %></div>
mas quando crio uma nova entrada, a mensagem de aviso não aparece após o redirecionamento para tv_shows_path. Alguém tem uma idéia do porquê?