app/controllers/lit/localizations_controller.rb in lit-0.0.3.1 vs app/controllers/lit/localizations_controller.rb in lit-0.0.4
- old
+ new
@@ -7,11 +7,11 @@
@localization.translated_value = @localization.get_value
respond_to :js
end
def update
- if @localization.update_attributes(params[:localization])
+ if @localization.update_attributes(clear_params)
Lit.init.cache.refresh_key @localization.full_key
end
respond_to :js
end
@@ -20,8 +20,16 @@
@localization_key = Lit::LocalizationKey.find(params[:localization_key_id])
end
def find_localization
@localization = @localization_key.localizations.find(params[:id])
+ end
+
+ def clear_params
+ if ::Rails::VERSION::MAJOR>=4
+ params[:localization].permit(:translated_value, :locale_id)
+ else
+ params[:localization]
+ end
end
end
end