mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-07 06:25:19 +02:00
Fix tab param initialization
This commit is contained in:
parent
0a90a208f0
commit
e7faa24f02
3 changed files with 3 additions and 2 deletions
|
@ -19,7 +19,7 @@ class UI::AccountPage < ApplicationComponent
|
|||
end
|
||||
|
||||
def active_tab
|
||||
tabs.find { |tab| tab == @active_tab } || tabs.first
|
||||
tabs.find { |tab| tab == @active_tab&.to_sym } || tabs.first
|
||||
end
|
||||
|
||||
def tabs
|
||||
|
|
|
@ -11,6 +11,7 @@ class AccountsController < ApplicationController
|
|||
|
||||
def show
|
||||
@chart_view = params[:chart_view] || "balance"
|
||||
@tab = params[:tab]
|
||||
@q = params.fetch(:q, {}).permit(:search)
|
||||
entries = @account.entries.search(@q).reverse_chronological
|
||||
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
account: @account,
|
||||
chart_view: @chart_view,
|
||||
chart_period: @period,
|
||||
active_tab: @active_tab
|
||||
active_tab: @tab
|
||||
) %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue