Class: Stay::Admin::PropertyCategoriesController

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



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

def create
  @property_category = Stay::PropertyCategory.new(property_category_params)
  if @property_category.save
    redirect_to admin_property_categories_path, notice: "Property Category was successfully created."
  else
    render :new
  end
end

#destroyObject



36
37
38
39
# File 'app/controllers/stay/admin/property_categories_controller.rb', line 36

def destroy
  @property_category.destroy
  redirect_to admin_property_categories_path, notice: "Property Category was successfully deleted."
end

#editObject



25
26
# File 'app/controllers/stay/admin/property_categories_controller.rb', line 25

def edit
end

#indexObject



5
6
7
# File 'app/controllers/stay/admin/property_categories_controller.rb', line 5

def index
  @property_categories = Stay::PropertyCategory.page(params[:page])
end

#newObject



9
10
11
# File 'app/controllers/stay/admin/property_categories_controller.rb', line 9

def new
  @property_category = Stay::PropertyCategory.new
end

#showObject



22
23
# File 'app/controllers/stay/admin/property_categories_controller.rb', line 22

def show
end

#updateObject



28
29
30
31
32
33
34
# File 'app/controllers/stay/admin/property_categories_controller.rb', line 28

def update
  if @property_category.update(property_category_params)
    redirect_to admin_property_categories_path, notice: "Property Category was successfully updated."
  else
    render :edit
  end
end