Rails 4, Ruby 2.3.1 (noob alert)
I have a restaurant reservation app. before a reservation is saved I need to check the db to ensure there is a table available. To do this I check the date and time selected in the form with a count:
Reservation.where(r_date:params[:r_date],r_time:params[:r_time]).count < 3
assuming the restaurant has 3 tables. If the count is more than 3 then there is not a table available.
How do I get the params from @reservation in the controller to the callback function in the model?
@reservationvar in your controller and what is "callback function in the model"? It is not quite clear what you mean.