What is the best practice for this situation?
I am building a reservation system, and I'm looking at the best way to capture and store information from a user. Each resource is available for one day and can take any amount of users up to the maximum. So for example, say it's a hot air balloon with a maximum of 5 people. I want my form to look like this:
[Buttons to select # of guests] // So if a user wants the same price for 1-3 people he only has to enter it once.
From [START DATE] to [END DATE]: [RATE] // Where the []'s are input fields for the user
I plan to store each price in the database as:
Date, # of guests, rate
So one row for each date.
So I need to convert "[START DATE]
to [END DATE]
" to storing the values for each date. Should I do that 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 I can store that in the DB for better querying? Or should I not bother because if tomorrow the user wants to change the price for 2 guests, it might screw up my db.