Class: Stay::Admin::HouseRulesController
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
19
20
21
22
23
24
25
26
|
# File 'app/controllers/stay/admin/house_rules_controller.rb', line 19
def create
@house_rule = Stay::HouseRule.new(house_rule_params)
if @house_rule.save
redirect_to admin_house_rule_path(@house_rule), notice: "House Rule was successfully created."
else
render :new, status: :unprocessable_entity
end
end
|
#destroy ⇒ Object
36
37
38
39
|
# File 'app/controllers/stay/admin/house_rules_controller.rb', line 36
def destroy
@house_rule.destroy!
redirect_to admin_house_rules_url, notice: "House Rule was successfully destroyed.", status: :see_other
end
|
#edit ⇒ Object
16
17
|
# File 'app/controllers/stay/admin/house_rules_controller.rb', line 16
def edit
end
|
#index ⇒ Object
5
6
7
|
# File 'app/controllers/stay/admin/house_rules_controller.rb', line 5
def index
@house_rules = Stay::HouseRule.page(params[:page])
end
|
#new ⇒ Object
12
13
14
|
# File 'app/controllers/stay/admin/house_rules_controller.rb', line 12
def new
@house_rule = Stay::HouseRule.new
end
|
#show ⇒ Object
9
10
|
# File 'app/controllers/stay/admin/house_rules_controller.rb', line 9
def show
end
|
#update ⇒ Object
28
29
30
31
32
33
34
|
# File 'app/controllers/stay/admin/house_rules_controller.rb', line 28
def update
if @house_rule.update(house_rule_params)
redirect_to admin_house_rule_path(@house_rule), notice: "House Rule was successfully updated.", status: :see_other
else
render :edit, status: :unprocessable_entity
end
end
|