Colin i try what you tell me. It work find. Thank very much.
The next step is that: if an user choice the seat on the hall, it must
not be appear againt on the view.
I have some view like this:
<%= form_tag( riepilogo_path, method: "post", id: "sel") do %>
<%= hidden_field_tag "sala", params[:sala] %>
<%= hidden_field_tag "spectacle_id", params[:spectacle_id] %>
<%= hidden_field_tag "num", params[:num] %>
<table>
<tr>
<th></th>
<th>Numero</th>
</tr>
<% for posti in @postis %>
<tr>
<td><%= check_box_tag "posti_ids[]",
posti.id %></td>
<td><%=h posti.numero %></td>
</tr>
<% end %>
</table>
<%= submit_tag "OK", id: "sub"%>
<% end %>
controller of Postis is something like so:
class PostisController < ApplicationController
def index
@postis = Posti.where(:stato => "unchecked" , :spectacle_id =>
params[:spectacle_id] , :hall_num => params[:sala])
end
def posti_multiple
@postis = Posti.find(params[:posti_ids])
end
end
In the Posti's model i have attributes: spectacle_id, hall_num,
seat(integer) and stato (:default => "unchecked").
An user choice her seat on the hall. When he submit the form, seats be
load in posti_ids[]. I want to update stato of seats wich are present in
posti_ids from "unchecked" to "checked" on the database. How can do
that. Thank you very much