Class: Stay::Admin::RoomAmenitiesController

Inherits:
BaseController show all
Defined in:
app/controllers/stay/admin/room_amenities_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#load_stores, #set_currency, #set_current_store, #stores_scope

Methods included from ControllerHelpers::Store

#current_store, #ensure_current_store, #store_locale

Methods included from ControllerHelpers::Currency

#currency_param, #current_currency, #supported_currencies, #supported_currencies_for_all_stores, #supported_currency?

Methods inherited from Stay::ApplicationController

#after_sign_in_path_for, #current_store

Methods included from LocaleHelper

#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?

Methods included from CurrencyHelper

#currency_options, #currency_presentation, #currency_symbol, #should_render_currency_dropdown?, #supported_currency_options

Instance Method Details

#createObject



14
15
16
17
18
19
20
21
# File 'app/controllers/stay/admin/room_amenities_controller.rb', line 14

def create
  @room_amenity = Stay::RoomAmenity.new(room_amenity_params.merge(stay_room_id: params[:room_id]))
  if @room_amenity.save
    redirect_to admin_property_room_room_amenities_path(@property, @room), notice: 'Room Amenity was successfully added.'
  else
    render :new
  end
end

#destroyObject



23
24
25
26
# File 'app/controllers/stay/admin/room_amenities_controller.rb', line 23

def destroy
   @room_amenity.destroy
   redirect_to admin_property_room_room_amenities_path, notice: 'Room Amenity was successfully destroyed.'
end

#indexObject



6
7
8
# File 'app/controllers/stay/admin/room_amenities_controller.rb', line 6

def index 
 @room_amenities =  @room.room_amenities
end

#newObject



10
11
12
# File 'app/controllers/stay/admin/room_amenities_controller.rb', line 10

def new
  @room_amenity = Stay::RoomAmenity.new
end