Class: Stay::Admin::RoomTypesController

Inherits:
BaseController show all
Defined in:
app/controllers/stay/admin/room_types_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

POST /admin/room_types



16
17
18
19
20
21
22
23
# File 'app/controllers/stay/admin/room_types_controller.rb', line 16

def create
  @room_type = Stay::RoomType.new(room_type_params)
  if @room_type.save
    redirect_to admin_room_types_path, notice: 'Room type was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /admin/room_types/:id



43
44
45
46
# File 'app/controllers/stay/admin/room_types_controller.rb', line 43

def destroy
  @room_type.destroy
  redirect_to admin_room_types_path, notice: 'Room type was successfully deleted.'
end

#editObject

GET /admin/room_types/:id/edit



30
31
# File 'app/controllers/stay/admin/room_types_controller.rb', line 30

def edit
end

#indexObject

GET /admin/room_types



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

def index
  @room_types = Stay::RoomType.page(params[:page])
end

#newObject

GET /admin/room_types/new



11
12
13
# File 'app/controllers/stay/admin/room_types_controller.rb', line 11

def new
  @room_type = Stay::RoomType.new
end

#showObject

GET /admin/room_types/:id



26
27
# File 'app/controllers/stay/admin/room_types_controller.rb', line 26

def show
end

#updateObject

PATCH/PUT /admin/room_types/:id



34
35
36
37
38
39
40
# File 'app/controllers/stay/admin/room_types_controller.rb', line 34

def update
  if @room_type.update(room_type_params)
    redirect_to admin_room_types_path, notice: 'Room type was successfully updated.'
  else
    render :edit
  end
end