Class: BookingTemplatesController

Inherits:
HasAccountsController
  • Object
show all
Defined in:
app/controllers/booking_templates_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

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_bookingObject



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

#updateObject



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