From 2b214785d9b31ffe0a548b88c20787daec74ec06 Mon Sep 17 00:00:00 2001 From: carisaelam Date: Tue, 3 Sep 2024 10:41:05 -0400 Subject: [PATCH] Add header logo image --- .../default.png => app/assets/images/logo.png | Bin app/assets/stylesheets/application.css | 18 +++--------------- app/views/layouts/application.html.erb | 1 + app/views/shared/_header.html.erb | 3 +++ config/routes.rb | 13 +------------ 5 files changed, 8 insertions(+), 27 deletions(-) rename public/default.png => app/assets/images/logo.png (100%) create mode 100644 app/views/shared/_header.html.erb diff --git a/public/default.png b/app/assets/images/logo.png similarity index 100% rename from public/default.png rename to app/assets/images/logo.png diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 288b9ab..11cc47b 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,15 +1,3 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's - * vendor/assets/stylesheets directory can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any other CSS - * files in this directory. Styles in this file should be added after the last require_* statement. - * It is generally better to create a new file per style scope. - * - *= require_tree . - *= require_self - */ +.header__image__container { + display: flex; +} \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 8c29e6b..bbddee2 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -18,6 +18,7 @@ + <%= render '/shared/header' %> <%= yield %> diff --git a/app/views/shared/_header.html.erb b/app/views/shared/_header.html.erb new file mode 100644 index 0000000..7b981ec --- /dev/null +++ b/app/views/shared/_header.html.erb @@ -0,0 +1,3 @@ +
+ <%= image_tag('logo.png', style: 'width: clamp(10rem, 50vw, 40rem); margin-inline: auto;') %> +
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 213ed56..9c30ebd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,15 +1,4 @@ Rails.application.routes.draw do - resources :posts - # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html - - # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. - # Can be used by load balancers and uptime monitors to verify that the app is live. - get "up" => "rails/health#show", as: :rails_health_check - - # Render dynamic PWA files from app/views/pwa/* - get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker - get "manifest" => "rails/pwa#manifest", as: :pwa_manifest - - # Defines the root path route ("/") root "posts#index" + resources :posts end