I have a view about holidays where a user uses a form to choose a place to travel and a hotel. It has two models: HolidaysPlaces and HolidaysHotels.
The user have to fill the form in this order using the view:
- The user completes the fields called Place and City (related with the HolidaysPlaces model).
- The user checked a checkbox if he/she wants to choose a hotel. It able a field called Hotel (related with HolidaysHotels model).
- The user completes that field.
- The user press a Create button.
- The controller receives and saves both models.
But the problem is when the user doesn't select the checkbox (number 2 of the list): The Hotel fieldis still required
(with the red asterisk as defined in its model file). So the Create button doesn't work in this case.
How can I disabled the required feature?