What is the best practice for this situation?
I am creating a reservation system and I am looking for the best way to capture and store information from the user. Each resource is available for one day and can accept any number of users to the maximum. So, for example, say that it is a balloon with a maximum of 5 people. I want my form to look like this:
[Buttons to select
From [START DATE] to [END DATE]: [RATE] // Where the [] are input fields for the user
I plan to store each price in a database as:
Date,
So, one line for each date.
Therefore, I need to convert " [START DATE]to [END DATE]" to store the values โโfor each date. Should I do this client side in Javascript or in my controller in rails? If the rates are the same for a set of guests, i.e. 1-3 guests, is there a way to save this in the database for a better request? Or I should not worry, because if tomorrow the user wants to change the price for 2 guests, this may ruin my dB.
source
share