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