def update_rules
      @rules = rules_by_dependency(parse_language_rules)
    
      unless params[:rule_action]
        return render(:partial => "edit_rules")
      end

      if params[:rule_action].index("add_at")
        position = params[:rule_action].split("_").last.to_i
        cls = Tr8n::Config.language_rule_dependencies[params[:rule_type]]
        @rules[cls.dependency].insert(position, cls.new(:language => tr8n_current_language))
      elsif params[:rule_action].index("delete_at")
        position = params[:rule_action].split("_").last.to_i
        cls = Tr8n::Config.language_rule_dependencies[params[:rule_type]]
        @rules[cls.dependency].delete_at(position)
      end
    
      render :partial => "edit_rules"      
    end
def update_rules
      @rules = rules_by_dependency(parse_language_rules)
    
      unless params[:rule_action]
        return render(:partial => "edit_rules")
      end

      if params[:rule_action].index("add_at")
        position = params[:rule_action].split("_").last.to_i
        cls = Tr8n::Config.language_rule_dependencies[params[:rule_type]]
        @rules[cls.dependency].insert(position, cls.new(:language => tr8n_current_language))
      elsif params[:rule_action].index("delete_at")
        position = params[:rule_action].split("_").last.to_i
        cls = Tr8n::Config.language_rule_dependencies[params[:rule_type]]
        @rules[cls.dependency].delete_at(position)
      end
    
      render :partial => "edit_rules"      
    end
ajax method for updating language rules in edit mode