Por qué es: el aviso no se muestra después de la redirección en Rails 3
Tengo el siguiente código en mi 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
y lo siguiente en mi tv_shows / index.html.erb
<div id="notice"><%= notice %></div>
pero cuando creo una nueva entrada, el mensaje de aviso no aparece después de la redirección a tv_shows_path. ¿Alguien tiene una idea de por qué?