language_mappings_controller.rb revision eeb6f931aa04060091972e9e7c163edc1d20b506
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen#
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen# Controller for LanguageMappings
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen#
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausenclass LanguageMappingsController < MappingsController
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen# belongs_to :source, :class_name => "Language"
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen# belongs_to :target, :class_name => "Language"
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen belongs_to :language
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen load_and_authorize_resource :except => [:index, :show]
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen def destroy
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen destroy! do |format|
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen format.html { redirect_to parent_path }
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen end
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen end
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen def create
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen @language_mapping.user = current_user
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen super
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen end
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausen
eeb6f931aa04060091972e9e7c163edc1d20b506Christian Clausenend