From 0aed68a7e383ff735a68f0912b991e654cde8ea4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 17 Nov 2019 19:26:13 -0600 Subject: [PATCH] Rename home#index to react#react --- ...home_controller.rb => react_controller.rb} | 12 +++++------ .../index.html.haml => react/react.html.haml} | 0 config/routes.rb | 20 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) rename app/controllers/{home_controller.rb => react_controller.rb} (87%) rename app/views/{home/index.html.haml => react/react.html.haml} (100%) diff --git a/app/controllers/home_controller.rb b/app/controllers/react_controller.rb similarity index 87% rename from app/controllers/home_controller.rb rename to app/controllers/react_controller.rb index 3cdc9fb9..62534ade 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/react_controller.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true -class HomeController < ApplicationController - before_action :authenticate_user! - before_action :set_referrer_policy_header - before_action :set_initial_state_json - before_action :set_data_for_meta +class ReactController < ApplicationController + before_action :authenticate_user!, only: :react + before_action :set_referrer_policy_header, only: :react + before_action :set_initial_state_json, only: :react + before_action :set_data_for_meta, only: :react - def index + def react @body_classes = 'app-body' end diff --git a/app/views/home/index.html.haml b/app/views/react/react.html.haml similarity index 100% rename from app/views/home/index.html.haml rename to app/views/react/react.html.haml diff --git a/config/routes.rb b/config/routes.rb index 74b1b2cd..e922cc87 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -240,7 +240,7 @@ Rails.application.routes.draw do resources :users, only: [] do resource :two_factor_authentication, only: [:destroy] end - + resources :custom_emojis, only: [:index, :new, :create, :update, :destroy] do member do post :copy @@ -452,17 +452,17 @@ Rails.application.routes.draw do get '/about/dmca', to: 'about#dmca' get '/about/sales', to: 'about#sales' - get '/tags/:tag', to: 'home#index' - get '/:username', to: 'home#index', as: :short_account - get '/:username/with_replies', to: 'home#index', as: :short_account_with_replies - get '/:username/media', to: 'home#index', as: :short_account_media - get '/:username/tagged/:tag', to: 'home#index', as: :short_account_tag - get '/:username/posts/:statusId/reblogs', to: 'home#index' - get '/:account_username/posts/:id', to: 'home#index', as: :short_account_status + get '/tags/:tag', to: 'react#react' + get '/:username', to: 'react#react', as: :short_account + get '/:username/with_replies', to: 'react#react', as: :short_account_with_replies + get '/:username/media', to: 'react#react', as: :short_account_media + get '/:username/tagged/:tag', to: 'react#react', as: :short_account_tag + get '/:username/posts/:statusId/reblogs', to: 'react#react' + get '/:account_username/posts/:id', to: 'react#react', as: :short_account_status get '/:account_username/posts/:id/embed', to: 'statuses#embed', as: :embed_short_account_status - get '/(*any)', to: 'home#index', as: :web - root 'home#index' + get '/(*any)', to: 'react#react', as: :web + root 'react#react' # Routes that are now to be used within webapp, but still referenced within application # TODO : Consolidate