<commit_before>class TasksController < ApplicationController
  include ApplicationHelper
  before_action :authorize

  def create
    @house_chore = HouseChore.find(params[:house_chore_id])
    @task = @house_chore.tasks.build(task_params)

    if @task.save
     redirect_to house_chore_path(@house_chore)
    else
      raise params.inspect
      flash[:notice] = "Task was not saved"

      render :'house_chore/show'
    end
  end

  def destroy
    @house_chore = HouseChore.find(params[:house_chore_id])
    @task = Task.find(params[:task_id] || params[:id])
    @task.destroy
<commit_msg>changed tasks#create method to handle json or html<commit_after>class TasksController < ApplicationController
  include ApplicationHelper
  before_action :authorize

  def create
    @house_chore = HouseChore.find(params[:house_chore_id])
    @task = @house_chore.tasks.build(task_params)

    if @task.save
      respond_to do |f|
        f.json {render :json => @task}
        f.html {redirect_to house_chore_path(@house_chore)}
      end
    else
      raise params.inspect
      flash[:notice] = "Task was not saved"

      render :'house_chore/show'
    end
  end

  def destroy
    @house_chore = HouseChore.find(params[:house_chore_id])
    @task = Task.find(params[:task_id] || params[:id])
    @task.destroy

{'fraction_non_alphanumeric': 0.09984756097560976, 'fraction_numerical': 0.0, 'mean_word_length': 3.5749128919860627, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '3727892', 'n_tokens_mistral': 433, 'n_tokens_neox': 424, 'n_words': 90}