From 9aef987f95d40a84a0c9fc75438e70b9064e8292 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Sun, 10 Mar 2024 18:47:33 -0700 Subject: [PATCH] Move partials in views/static to views/application I think this is the more canonical place for stuff like this these days! It's nice to be able to just say the short name when calling `render`. Here's the answer I looked up about it: https://stackoverflow.com/a/9892081/107415 My immediate motivation is that I'm looking at creating more About pages, and thinking about where to put them; I think maybe we trash the `StaticController`, move these partials out to here, and move terms into a new `AboutController`? --- app/views/{static => application}/_analytics.html.erb | 0 app/views/{static => application}/_announcement.html | 0 app/views/layouts/application.html.haml | 4 ++-- app/views/outfits/edit.html.haml | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename app/views/{static => application}/_analytics.html.erb (100%) rename app/views/{static => application}/_announcement.html (100%) diff --git a/app/views/static/_analytics.html.erb b/app/views/application/_analytics.html.erb similarity index 100% rename from app/views/static/_analytics.html.erb rename to app/views/application/_analytics.html.erb diff --git a/app/views/static/_announcement.html b/app/views/application/_announcement.html similarity index 100% rename from app/views/static/_announcement.html rename to app/views/application/_announcement.html diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index c275face..d21b9921 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -13,7 +13,7 @@ %link{href: image_path('favicon.png'), rel: 'icon'} = yield :stylesheets = stylesheet_link_tag "application" - = render 'static/analytics' + = render 'analytics' = yield :meta = open_graph_tags = csrf_meta_tag @@ -24,7 +24,7 @@ %body{:class => body_class} #container = yield :before_title - = render 'static/announcement' + = render 'announcement' - if content_for?(:title) && show_title_header? %h1#title= yield :title = yield :before_flashes diff --git a/app/views/outfits/edit.html.haml b/app/views/outfits/edit.html.haml index 06f1b85d..0c6d21f0 100644 --- a/app/views/outfits/edit.html.haml +++ b/app/views/outfits/edit.html.haml @@ -17,7 +17,7 @@ %link{href: image_path('favicon.png'), rel: 'icon'} = stylesheet_link_tag 'fonts' = javascript_include_tag 'wardrobe-2020-page', defer: true - = render 'static/analytics' + = render 'analytics' = open_graph_tags = csrf_meta_tags = impress_2020_meta_tags