Why do I get the error ActionController :: UrlGenerationError in Ruby when trying to create a new record?

1

I have a view where I will create series and I have a list, from the list I link to the aggregation of My series, but mark this error

index.html.erb file

<section class="capturar">


</section>

<section class="detalles">

</section>


<center>
<h2 style="color:blue;font-size:32px"> Lista de Series </h2>
<%= link_to "Agregar nueva Serie", new_series_path,:class=>"nuevo" %>


</center>

File _guardar_guardar_guardar.html.erb

<section class="formulario">

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


<form>


 <%= f.label "Titulo" %>
      <%= f.text_field :class=>"caja"%>



   <p>
      <%= f.submit "Enviar",:class=>"button success" %> <%= link_to "Cancelar", series_path,:class=>"button alert" %>
   </p>

   </form>

<% end %>
</section>

<br><br>

Method new

  def new
           @serie = Serie.new();

  end

It is supposed that what the method should do is show me at least the screen to be able to create a new series

I have another method and class in the same way that it is only that I do not know if the routes are bad or modified or for some reason the method of updating is bringing me because apparently it asks parameters that should not be the case.

    
asked by David 02.09.2016 в 06:55
source

1 answer

1

Since there is no code that corresponds to the error, my answer is based on simple assumption.
As the error message says, your problem is in the app/views/series/_formulario_guardar_serie.html.erb file on the #3 line. There "I assume" you must have a serie_path to which you are not passing any id or a null value (in case you are doing something like serie_path(serie) and you have not assigned a value for serie ). I hope this guides you to what causes your error, but adds more of the relevant code to see what it might be.

As advice for future questions:

  • Do not put Here's my code from the Listing , but the name of the file you're showing
  • Instead of putting a screenshot of your error, better copy the text of the error, which is much easier to manipulate for those who could answer, in addition to the image you put must be viewed with a magnifying glass to see the detail. The text can be copied from the log it shows on the server console or, in the worst case, from the same page where it shows you the error.
answered by 02.09.2016 в 18:12