<commit_before>class UrlsController < ApplicationController

  def index
    @urls = Url.all

    render json: @urls
  end

  def show
    @url = Url.find(params[:id])

    render json: @url
  end

  def create
    @url = Url.create(url_params)

    if @url.save
      render json: @url, status: :created
    else
      render json: @url.errors, status: :unprocessable_entity
    end
  end

  def update
    @url = Url.find(params[:id])
    if @url.update(url_params)
      render json: @url
    else
      render json: @page_errors, status: :unprocessable_entity
    end

  end

  def destroy
    @url = Url.find(params[:id])
    @url.destroy
  end

  private



  def url_params
    params.require(:url).permit(:page_url)
  end




end
<commit_msg>Add CRUD actions for url_contents controller<commit_after>class UrlsController < ApplicationController

  def index
    @urls = Url.all

    render json: @urls
  end

  def show
    @url = Url.find(params[:id])

    render json: @url
  end

  def create
    @url = Url.create(url_params)

    if @url.save
      render json: @url, status: :created
    else
      render json: @url.errors, status: :unprocessable_entity
    end
  end

  def update
    @url = Url.find(params[:id])
    if @url.update(url_params)
      render json: @url
    else
      render json: @page_errors, status: :unprocessable_entity
    end

  end

  def destroy
    @url = Url.find(params[:id])
    @url.destroyurls
  end

  private



  def url_params
    params.require(:url).permit(:page_url)
  end




end

{'fraction_non_alphanumeric': 0.09641693811074918, 'fraction_numerical': 0.0, 'mean_word_length': 2.588785046728972, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7466959', 'n_tokens_mistral': 548, 'n_tokens_neox': 518, 'n_words': 139}