1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-23 15:19:38 +02:00

Fix: Omit layout for turbo frames with custom sidebar layout (#1024)

* Define layout method

* Use with_sidebar method

---------

Co-authored-by: Pranav Babu <babu@maindeck.io>
This commit is contained in:
pranavbabu 2024-07-26 18:00:41 +02:00 committed by GitHub
parent dfc7e1c30c
commit 7ba9830db5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 21 additions and 13 deletions

View file

@ -1,5 +1,5 @@
class Account::EntriesController < ApplicationController class Account::EntriesController < ApplicationController
layout "with_sidebar" layout :with_sidebar
before_action :set_account before_action :set_account
before_action :set_entry, only: %i[ edit update show destroy ] before_action :set_entry, only: %i[ edit update show destroy ]

View file

@ -1,5 +1,5 @@
class Account::HoldingsController < ApplicationController class Account::HoldingsController < ApplicationController
layout "with_sidebar" layout :with_sidebar
before_action :set_account before_action :set_account
before_action :set_holding, only: :show before_action :set_holding, only: :show

View file

@ -1,5 +1,5 @@
class Account::TransfersController < ApplicationController class Account::TransfersController < ApplicationController
layout "with_sidebar" layout :with_sidebar
before_action :set_transfer, only: :destroy before_action :set_transfer, only: :destroy

View file

@ -1,5 +1,5 @@
class AccountsController < ApplicationController class AccountsController < ApplicationController
layout "with_sidebar" layout :with_sidebar
include Filterable include Filterable
before_action :set_account, only: %i[ edit show destroy sync update ] before_action :set_account, only: %i[ edit show destroy sync update ]

View file

@ -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. # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
allow_browser versions: :modern allow_browser versions: :modern
private
def with_sidebar
return "turbo_rails/frame" if turbo_frame_request?
"with_sidebar"
end
end end

View file

@ -1,5 +1,5 @@
class CategoriesController < ApplicationController class CategoriesController < ApplicationController
layout "with_sidebar" layout :with_sidebar
before_action :set_category, only: %i[ edit update ] before_action :set_category, only: %i[ edit update ]
before_action :set_transaction, only: :create before_action :set_transaction, only: :create

View file

@ -1,5 +1,5 @@
class Category::DeletionsController < ApplicationController class Category::DeletionsController < ApplicationController
layout "with_sidebar" layout :with_sidebar
before_action :set_category before_action :set_category
before_action :set_replacement_category, only: :create before_action :set_replacement_category, only: :create

View file

@ -1,5 +1,5 @@
class Help::ArticlesController < ApplicationController class Help::ArticlesController < ApplicationController
layout "with_sidebar" layout :with_sidebar
def show def show
@article = Help::Article.find(params[:id]) @article = Help::Article.find(params[:id])

View file

@ -1,5 +1,5 @@
class MerchantsController < ApplicationController class MerchantsController < ApplicationController
layout "with_sidebar" layout :with_sidebar
before_action :set_merchant, only: %i[ edit update destroy ] before_action :set_merchant, only: %i[ edit update destroy ]

View file

@ -1,5 +1,5 @@
class PagesController < ApplicationController class PagesController < ApplicationController
layout "with_sidebar" layout :with_sidebar
include Filterable include Filterable

View file

@ -1,3 +1,3 @@
class SettingsController < ApplicationController class SettingsController < ApplicationController
layout "with_sidebar" layout :with_sidebar
end end

View file

@ -1,5 +1,5 @@
class Tag::DeletionsController < ApplicationController class Tag::DeletionsController < ApplicationController
layout "with_sidebar" layout :with_sidebar
before_action :set_tag before_action :set_tag
before_action :set_replacement_tag, only: :create before_action :set_replacement_tag, only: :create

View file

@ -1,5 +1,5 @@
class TagsController < ApplicationController class TagsController < ApplicationController
layout "with_sidebar" layout :with_sidebar
before_action :set_tag, only: %i[ edit update ] before_action :set_tag, only: %i[ edit update ]

View file

@ -1,5 +1,5 @@
class TransactionsController < ApplicationController class TransactionsController < ApplicationController
layout "with_sidebar" layout :with_sidebar
def index def index
@q = search_params @q = search_params