Why do I get this error in Ruby "ActionController :: UrlGenerationError"?

1

What I want to get is to get to my form to be able to add information or new records but the problem is that when I click on add new, I get an error tab.

Controller

 def new
           @serie = Serie.new();

  end

  def create
@folio = params[:serie][:folio];
   @serie = Serie.new({
      :folio => @folio
      });
   if @serie.save()
      redirect_to series_path, :notice => "La Serie ha sido insertada";
   else
      render "new";
   end
  end

View

<section class="formulario">


<%= form_for @serie do |f| %> 

<form>

<label>Hola Mundo</label>>
   </form>

   <% end %>



</section>

This is the error that comes to me

    
asked by David 18.12.2016 в 21:17
source

1 answer

0

I see that your code has; You must remove it. Rails does not use that syntax.

It's wrong your redirect_to series_path, :notice => "La Serie ha sido insertada"

change it to redirect_to @serie, :notice => "La Serie ha sido insertada"

    
answered by 19.01.2017 в 00:02