Class: KktShoppe::ProductCategoryLocalisationsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- KktShoppe::ProductCategoryLocalisationsController
- Defined in:
- app/controllers/kkt_shoppe/product_category_localisations_controller.rb
Instance Method Summary collapse
Instance Method Details
permalink #create ⇒ Object
[View source]
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/kkt_shoppe/product_category_localisations_controller.rb', line 19 def create if I18n.available_locales.include? safe_params[:locale].to_sym I18n.locale = safe_params[:locale].to_sym if @product_category.update(safe_params) I18n.locale = I18n.default_locale redirect_to [@product_category, :localisations], :flash => { :notice => t("kkt_shoppe.localisations.localisation_created") } else render :action => "edit" end else redirect_to [@product_category, :localisations] end end |
permalink #destroy ⇒ Object
[View source]
46 47 48 49 |
# File 'app/controllers/kkt_shoppe/product_category_localisations_controller.rb', line 46 def destroy @localisation.destroy redirect_to [@product_category, :localisations], :notice => t('kkt_shoppe.localisations.localisation_destroyed') end |
permalink #edit ⇒ Object
[View source]
34 35 36 |
# File 'app/controllers/kkt_shoppe/product_category_localisations_controller.rb', line 34 def edit render :action => "form" end |
permalink #index ⇒ Object
[View source]
10 11 12 |
# File 'app/controllers/kkt_shoppe/product_category_localisations_controller.rb', line 10 def index @localisations = @product_category.translations end |
permalink #new ⇒ Object
[View source]
14 15 16 17 |
# File 'app/controllers/kkt_shoppe/product_category_localisations_controller.rb', line 14 def new @localisation = @product_category.translations.new render :action => "form" end |
permalink #update ⇒ Object
[View source]
38 39 40 41 42 43 44 |
# File 'app/controllers/kkt_shoppe/product_category_localisations_controller.rb', line 38 def update if @localisation.update(safe_params) redirect_to [@product_category, :localisations], :notice => t('kkt_shoppe.localisations.localisation_updated') else render :action => "form" end end |