Class: BookingTemplatesController
- Inherits:
-
HasAccountsController
- Object
- HasAccountsController
- BookingTemplatesController
- Defined in:
- app/controllers/booking_templates_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
Actions
3 4 5 6 7 |
# File 'app/controllers/booking_templates_controller.rb', line 3 def create create! do |success, failure| success.html { redirect_to collection_path } end end |
#new_booking ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/controllers/booking_templates_controller.rb', line 15 def new_booking booking_params = params[:booking] || {} booking_params[:value_date] ||= Date.today booking_params[:code] ||= (Booking.maximum(:code) || 0) + 1 booking_parameters = @booking_template.booking_parameters(booking_params) redirect_to simple_edit_bookings_path(:booking => booking_parameters) end |
#update ⇒ Object
9 10 11 12 13 |
# File 'app/controllers/booking_templates_controller.rb', line 9 def update update! do |success, failure| success.html { redirect_to collection_path } end end |