<commit_before>class SharesController < SecuredController
  def index
    @shares = Share.all.order(id: :desc).limit(50)
  end

  def new
    @share = Share.new
  end

  def create
    share = Share.new(share_params)
    share.user = current_user
    if share.save
      render plain: { message: 'success' }
    else
      render plain: { message: 'fail' }
    end
  end

  def share_params
    params.require(:share).permit(:url, :title, :description, :category)
  end
end<commit_msg>fixed new route to render partial for form<commit_after>class SharesController < SecuredController
  def index
    @shares = Share.all.order(id: :desc).limit(50)
  end

  def new
    @share = Share.new
    render "/shares/new"
  end

  def create
    share = Share.new(share_params)
    share.user = current_user
    if share.save
      render plain: { message: 'success' }
    else
      render plain: { message: 'fail' }
    end
  end

  def share_params
    params.require(:share).permit(:url, :title, :description, :category)
  end
end
{'fraction_non_alphanumeric': 0.103515625, 'fraction_numerical': 0.00390625, 'mean_word_length': 2.9728682170542635, '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': '6870464', 'n_tokens_mistral': 337, 'n_tokens_neox': 328, 'n_words': 90}