<commit_before>class StoresController < ApplicationController
  before_action :authenticate_user!
  before_action :authorize_manager!
  before_action :authorize_group_manager!, only: [:new, :create, :destroy]
  before_action :find_group

  def show
    @store = policy_scope(Store).find(params[:id])
  end

  def new
    @store = @group.stores.new
  end

  def create
    @store = @group.stores.build(store_params)

    if @store.save
      redirect_to account_stores_path, notice: '新增商店成功'
    else
      render :account_new
    end
  end

  def edit
    @store = policy_scope(Store).find(params[:id])
  end

  def update
    @store = policy_scope(Store).find(params[:id])

    if @store.update(store_params)
      redirect_to account_stores_path, notice: "修改商店成功"
    else
      render :account_edit
    end
  end

  def destroy
    @store = policy_scope(Store).find(params[:id])

    @store.destroy
    redirect_to account_stores_path, alert: "商店已刪除"
  end

  private

  def store_params
    params.require(:store).permit(:title, :phone, :landline, :location)
  end
<commit_msg>fix create store fail render error path<commit_after>class StoresController < ApplicationController
  before_action :authenticate_user!
  before_action :authorize_manager!
  before_action :authorize_group_manager!, only: [:new, :create, :destroy]
  before_action :find_group

  def show
    @store = policy_scope(Store).find(params[:id])
  end

  def new
    @store = @group.stores.new
  end

  def create
    @store = @group.stores.build(store_params)

    if @store.save
      redirect_to account_stores_path, notice: '新增商店成功'
    else
      render :new
    end
  end

  def edit
    @store = policy_scope(Store).find(params[:id])
  end

  def update
    @store = policy_scope(Store).find(params[:id])

    if @store.update(store_params)
      redirect_to account_stores_path, notice: "修改商店成功"
    else
      render :edit
    end
  end

  def destroy
    @store = policy_scope(Store).find(params[:id])

    @store.destroy
    redirect_to account_stores_path, alert: "商店已刪除"
  end

  private

  def store_params
    params.require(:store).permit(:title, :phone, :landline, :location)
  end

{'fraction_non_alphanumeric': 0.09944751381215469, 'fraction_numerical': 0.0, 'mean_word_length': 3.633262260127932, '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': '5611592', 'n_tokens_mistral': 753, 'n_tokens_neox': 746, 'n_words': 162}