Class: Stay::Admin::BookingsController
Instance Method Summary
collapse
#load_stores, #set_currency, #set_current_store, #stores_scope
#current_store, #ensure_current_store, #store_locale
#currency_param, #current_currency, #supported_currencies, #supported_currencies_for_all_stores, #supported_currency?
#after_sign_in_path_for, #current_store
#all_locales_options, #available_locales, #available_locales_options, #config_locale?, #current_locale, #find_with_fallback_default_locale, #locale_full_name, #locale_param, #locale_presentation, #params_locale?, #should_render_locale_dropdown?, #supported_locale?, #supported_locales, #supported_locales_for_all_stores, #supported_locales_options, #user_locale?
#currency_options, #currency_presentation, #currency_symbol, #should_render_currency_dropdown?, #supported_currency_options
Instance Method Details
#create ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'app/controllers/stay/admin/bookings_controller.rb', line 18
def create
@booking = current_store.bookings.build(booking_params)
if @booking.save
redirect_to admin_booking_path(@booking), notice: 'Booking was successfully created.'
else
render :new
end
end
|
#destroy ⇒ Object
38
39
40
41
|
# File 'app/controllers/stay/admin/bookings_controller.rb', line 38
def destroy
@booking.destroy
redirect_to admin_bookings_url, notice: 'Booking was successfully destroyed.'
end
|
#edit ⇒ Object
27
28
|
# File 'app/controllers/stay/admin/bookings_controller.rb', line 27
def edit
end
|
#index ⇒ Object
6
7
8
9
|
# File 'app/controllers/stay/admin/bookings_controller.rb', line 6
def index
@q = current_store.bookings.ransack(params[:q])
@bookings = @q.result.order(created_at: :desc).page(params[:page])
end
|
#new ⇒ Object
14
15
16
|
# File 'app/controllers/stay/admin/bookings_controller.rb', line 14
def new
@booking = current_store.bookings.build
end
|
#show ⇒ Object
11
12
|
# File 'app/controllers/stay/admin/bookings_controller.rb', line 11
def show
end
|
#update ⇒ Object
30
31
32
33
34
35
36
|
# File 'app/controllers/stay/admin/bookings_controller.rb', line 30
def update
if @booking.update(booking_params)
redirect_to admin_booking_path(@booking), notice: 'Booking was successfully updated.'
else
render :edit
end
end
|