Answer the question
In order to leave comments, you need to log in
Why did the submit button on the form stop working to send a record to the database?
Hello, for some reason the "submit" button, which is responsible for sending a record to the database, has stopped working. Everything was fine before. Unfortunately, I did not upload the working version to github.
Here is the code of the form itself (appears when you click on the block).
<%= form_for(@place) do |f| %>
<div class="btn btn-primary place_block" id="place_<%= n %>" style="">
<p><%= @film_session.cinema.cinema_name %></p>
<p><%= @film_session.session_name %></p>
<p>Place № <%= n %></p>
<div class="hidden-block">
<a id="group" href="#data_<%= n %>">Booking</a>
</div>
<div class="hidden">
<div id="data_<%= n %>" class="<%= n %>">
<%= form_for(@place) do |f| %>
<% if @place.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@place.errors.count, "error") %> prohibited this place from being saved:</h2>
<ul>
<% @place.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.hidden_field :cinema_id, :value => @film_session.cinema_id %>
<%= f.label :cinema_name %><br>
<p><%= @cinema.cinema_name %></p>
</div>
<%= f.hidden_field :film_session_id, :value => @film_session.id %>
<%= f.hidden_field :place_number, :value => n %>
<div class="field">
<%= f.label :session_name %><br>
<p><%= @film_session.session_name %></p>
</div>
<div class="field">
<%= f.label :place_number %><br>
<p><%= n %></p>
</div>
<div class="field">
<%= f.label :status %><br>
<%= f.check_box :status, class:"form form-control" %>
</div>
<br/>
<div class="actions">
<%= f.submit "Booking", :class => "btn btn-primary" %>
</div>
<% end %>
</div>
</div>
</div>
<% end %>
def show
@booked_places = @film_session.places
@place = Place.new
@cinema = Cinema.find(params[:id])
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question