The personal finance app for everyone (by everyone)
Ruby
Fix: Omit layout for turbo frames with custom sidebar layout (#1024)
pranavbabu7ba9830db595
diff --git a/app/controllers/account/entries_controller.rb b/app/controllers/account/entries_controller.rbindex 22bbe34f09..70c04e673d 100644--- a/app/controllers/account/entries_controller.rb+++ b/app/controllers/account/entries_controller.rb@@ -1,5 +1,5 @@class Account::EntriesController < ApplicationController- layout "with_sidebar"+ layout :with_sidebarbefore_action :set_accountbefore_action :set_entry, only: %i[ edit update show destroy ]diff --git a/app/controllers/account/holdings_controller.rb b/app/controllers/account/holdings_controller.rbindex 136040ae88..14e7e9ff48 100644--- a/app/controllers/account/holdings_controller.rb+++ b/app/controllers/account/holdings_controller.rb@@ -1,5 +1,5 @@class Account::HoldingsController < ApplicationController- layout "with_sidebar"+ layout :with_sidebarbefore_action :set_accountbefore_action :set_holding, only: :showdiff --git a/app/controllers/account/transfers_controller.rb b/app/controllers/account/transfers_controller.rbindex ac60583a01..4fbf42688e 100644--- a/app/controllers/account/transfers_controller.rb+++ b/app/controllers/account/transfers_controller.rb@@ -1,5 +1,5 @@class Account::TransfersController < ApplicationController- layout "with_sidebar"+ layout :with_sidebarbefore_action :set_transfer, only: :destroydiff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rbindex 568f440f07..a02e1c9179 100644--- a/app/controllers/accounts_controller.rb+++ b/app/controllers/accounts_controller.rb@@ -1,5 +1,5 @@class AccountsController < ApplicationController- layout "with_sidebar"+ layout :with_sidebarinclude Filterablebefore_action :set_account, only: %i[ edit show destroy sync update ]diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rbindex b8d5a83647..2a3427fba8 100644--- a/app/controllers/application_controller.rb+++ b/app/controllers/application_controller.rb@@ -4,4 +4,12 @@ class ApplicationController < ActionController::Base# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.allow_browser versions: :modern++ private++ def with_sidebar+ return "turbo_rails/frame" if turbo_frame_request?++ "with_sidebar"+ endenddiff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rbindex dfbe63e441..219a6973ce 100644--- a/app/controllers/categories_controller.rb+++ b/app/controllers/categories_controller.rb@@ -1,5 +1,5 @@class CategoriesController < ApplicationController- layout "with_sidebar"+ layout :with_sidebarbefore_action :set_category, only: %i[ edit update ]before_action :set_transaction, only: :creatediff --git a/app/controllers/category/deletions_controller.rb b/app/controllers/category/deletions_controller.rbindex 96ff4c47ff..57f8ee5ff4 100644--- a/app/controllers/category/deletions_controller.rb+++ b/app/controllers/category/deletions_controller.rb@@ -1,5 +1,5 @@class Category::DeletionsController < ApplicationController- layout "with_sidebar"+ layout :with_sidebarbefore_action :set_categorybefore_action :set_replacement_category, only: :creatediff --git a/app/controllers/help/articles_controller.rb b/app/controllers/help/articles_controller.rbindex 17ff8fae20..e5b19ff3b8 100644--- a/app/controllers/help/articles_controller.rb+++ b/app/controllers/help/articles_controller.rb@@ -1,5 +1,5 @@class Help::ArticlesController < ApplicationController- layout "with_sidebar"+ layout :with_sidebardef show@article = Help::Article.find(params[:id])diff --git a/app/controllers/merchants_controller.rb b/app/controllers/merchants_controller.rbindex 17c1343f24..055f3da8d2 100644--- a/app/controllers/merchants_controller.rb+++ b/app/controllers/merchants_controller.rb@@ -1,5 +1,5 @@class MerchantsController < ApplicationController- layout "with_sidebar"+ layout :with_sidebarbefore_action :set_merchant, only: %i[ edit update destroy ]diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rbindex 92904be5c7..30f07532d5 100644--- a/app/controllers/pages_controller.rb+++ b/app/controllers/pages_controller.rb@@ -1,5 +1,5 @@class PagesController < ApplicationController- layout "with_sidebar"+ layout :with_sidebarinclude Filterablediff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rbindex f908b939da..e0fcac5ee7 100644--- a/app/controllers/settings_controller.rb+++ b/app/controllers/settings_controller.rb@@ -1,3 +1,3 @@class SettingsController < ApplicationController- layout "with_sidebar"+ layout :with_sidebarenddiff --git a/app/controllers/tag/deletions_controller.rb b/app/controllers/tag/deletions_controller.rbindex 19183c5711..a5b14f7c03 100644--- a/app/controllers/tag/deletions_controller.rb+++ b/app/controllers/tag/deletions_controller.rb@@ -1,5 +1,5 @@class Tag::DeletionsController < ApplicationController- layout "with_sidebar"+ layout :with_sidebarbefore_action :set_tagbefore_action :set_replacement_tag, only: :creatediff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rbindex 9a3ccebfb9..64b4a6e79f 100644--- a/app/controllers/tags_controller.rb+++ b/app/controllers/tags_controller.rb@@ -1,5 +1,5 @@class TagsController < ApplicationController- layout "with_sidebar"+ layout :with_sidebarbefore_action :set_tag, only: %i[ edit update ]diff --git a/app/controllers/transactions_controller.rb b/app/controllers/transactions_controller.rbindex 482ed9dbb2..55bb810042 100644--- a/app/controllers/transactions_controller.rb+++ b/app/controllers/transactions_controller.rb@@ -1,5 +1,5 @@class TransactionsController < ApplicationController- layout "with_sidebar"+ layout :with_sidebardef index@q = search_params