Context
Form is created through command
$ rails g scaffold Cotizacion
Template installed from link
Objective and problem
The idea is to integrate the form new
, which creates a new quote to the bootstrap template.
Understanding that I am trying to use a form that corresponds to another controller.
The structure of the project is as follows. You are trying to call the _form.html.erb form of the quotes view, from the index.html.erb file corresponding to the view < em> creatives . Both views occupy different controllers (can that be done?)
Invocation to form from index.html.erb :
<%= render :partial =>'cotizaciones/form' , cotizacion: @cotizacion%>
<%= render 'navbar' %>
<%= render 'header' %>
<%= render 'services' %>
<%= render 'portfolio' %>
<%= render 'call_to_action' %>
<%= render 'contact' %>
The message displayed by the application when lifting the page is the following:
undefined local variable or method 'quote' for < #: 0x007fcae29cb080 > Did you mean? quote_url
Extracted source (around line # 1):
<%= form_with(model: cotizacion, local: true) do |form| %> <%= form_with(model: cotizacion, local: true) do |form| %> <% if cotizacion.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(cotizacion.errors.count, "error") %> prohibited this cotizacion from being saved:</h2>