<commit_before>class LayersController < ApplicationController
  # GET /layers
  # GET /layers.xml
  def index
    @layers = Layer.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @layers }
    end
  end

  # GET /layers/1
  # GET /layers/1.xml
  def show
    @layer = Layer.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @layer }
      format.js { render :json => @layer.to_json(:include => {:points => {}, :paths => {:include => :coords} } ) }
    end
  end

  # GET /layers/new
  # GET /layers/new.xml
  def new
    @layer = Layer.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @layer }
    end
  end

  # GET /layers/1/edit
  def edit
    @layer = Layer.find(params[:id])
  end

  # POST /layers
  # POST /layers.xml
  def create
    @layer = Layer.new(params[:layer])

    respond_to do |format|
      if @layer.save
        format.html { redirect_to(@layer, :notice => 'Layer was successfully created.') }
        format.xml  { render :xml => @layer, :status => :created, :location => @layer }
      else
        format.html { render :action => "new" }<commit_msg>Reduce some of the bloat in layer js output.<commit_after>class LayersController < ApplicationController
  # GET /layers
  # GET /layers.xml
  def index
    @layers = Layer.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @layers }
    end
  end

  # GET /layers/1
  # GET /layers/1.xml
  def show
    @layer = Layer.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @layer }
      format.js { render :json => @layer.to_json(
        :include => {
          :points => {}, 
          :paths => {
            :include => { :coords => {
              :only => [:position, :latitude, :longitude]
            }}
          } 
        }
      )}
    end
  end

  # GET /layers/new
  # GET /layers/new.xml
  def new
    @layer = Layer.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @layer }
    end
  end

  # GET /layers/1/edit
  def edit
    @layer = Layer.find(params[:id])
  end

  # POST /layers
  # POST /layers.xml
  def create
    @layer = Layer.new(params[:layer])

    respond_to do |format|
      if @layer.save
        format.html { redirect_to(@layer, :notice => 'Layer was successfully created.') }
        format.xml  { render :xml => @layer, :status => :created, :location => @layer }
      else
        format.html { render :action => "new" }
{'fraction_non_alphanumeric': 0.13615903975993998, 'fraction_numerical': 0.002250562640660165, 'mean_word_length': 2.1083916083916083, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 24}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6628774', 'n_tokens_mistral': 901, 'n_tokens_neox': 865, 'n_words': 229}