<commit_before>FactlinkUI::Application.routes.draw do
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # User Authentication
  devise_for :users, :controllers => {  confirmations: "users/confirmations",
                                        sessions:      "users/sessions",
                                        passwords:      "<PASSWORD>"
                                      }

  # Web Front-end
  root :to => "home#index"

  scope '/api/beta' do
    get '/current_user' => 'users#current'
    get '/feed' => "api/feed#global"
    get '/feed/personal' => "api/feed#personal"
    get '/users/:username/feed' => 'api/users#feed'
    get '/annotations/:id' => 'api/annotations#show'
    post '/annotations' => 'api/annotations#create'
    get '/annotations/search' => 'api/annotations#search'
    get '/annotations/recently_viewed' => 'api/annotations#recently_viewed'
    post '/annotations/:id/share' => 'api/annotations#share'
  end

  # Javascript Client calls
  # TODO: replace /site/ gets with scoped '/sites/', and make it a resource (even if it only has show)
  get   "/site/count" => "sites#facts_count_for_url"
  get   "/site" => "sites#facts_for_url"

  # Prepare a new Fact
  # If you change this route, don't forget to change it in application.rb
  # as well (frame busting)
  get '/client/*page' => 'client#show'

  resources :facts, only: [] do
    resources :opinionators, only: [:index, :create, :destroy, :update]

    member do
      scope '/comments' do
        post "/" => 'comments#create'
        get "/" => 'comments#index'
        delete "/:id" => 'comments#destroy'
        put "/:id/opinion" => 'comments#update_opinion'

        scope '/:comment_id' do
          scope '/sub_comments' do
            get '' => 'sub_comments#index'
            post '' => 'sub_comments#create'
            delete "/:sub_comment_id" => 'sub_comments#destroy'
          end
        end
      end<commit_msg>Fixed routes<commit_after>FactlinkUI::Application.routes.draw do
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # User Authentication
  devise_for :users, :controllers => {  confirmations: "users/confirmations",
                                        sessions:      "users/sessions",
                                        passwords:      "<PASSWORD>"
                                      }

  # Web Front-end
  root :to => "home#index"

  scope '/api/beta' do
    get '/current_user' => 'users#current'
    get '/feed' => "api/feed#global"
    get '/feed/personal' => "api/feed#personal"
    get '/users/:username/feed' => 'api/users#feed'
    get '/annotations/recently_viewed' => 'api/annotations#recently_viewed'
    get '/annotations/search' => 'api/annotations#search'
    post '/annotations' => 'api/annotations#create'
    get '/annotations/:id' => 'api/annotations#show'
    post '/annotations/:id/share' => 'api/annotations#share'
  end

  # Javascript Client calls
  # TODO: replace /site/ gets with scoped '/sites/', and make it a resource (even if it only has show)
  get   "/site/count" => "sites#facts_count_for_url"
  get   "/site" => "sites#facts_for_url"

  # Prepare a new Fact
  # If you change this route, don't forget to change it in application.rb
  # as well (frame busting)
  get '/client/*page' => 'client#show'

  resources :facts, only: [] do
    resources :opinionators, only: [:index, :create, :destroy, :update]

    member do
      scope '/comments' do
        post "/" => 'comments#create'
        get "/" => 'comments#index'
        delete "/:id" => 'comments#destroy'
        put "/:id/opinion" => 'comments#update_opinion'

        scope '/:comment_id' do
          scope '/sub_comments' do
            get '' => 'sub_comments#index'
            post '' => 'sub_comments#create'
            delete "/:sub_comment_id" => 'sub_comments#destroy'
          end
        end
      end
{'fraction_non_alphanumeric': 0.1380891719745223, 'fraction_numerical': 0.0, 'mean_word_length': 2.390328151986183, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '196201', 'n_tokens_mistral': 1182, 'n_tokens_neox': 1135, 'n_words': 306}