Method: KktShoppe::ProductCategoryLocalisationsController#create

Defined in:
app/controllers/kkt_shoppe/product_category_localisations_controller.rb

#createObject



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