mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-23 15:19:38 +02:00
Add apply button, improve transaction filters (#655)
* Add apply button, improve transaction filters * Remove temp log * Fix lint errors
This commit is contained in:
parent
0277bc94f3
commit
c46662c99f
8 changed files with 89 additions and 49 deletions
|
@ -24,7 +24,16 @@ class TransactionsController < ApplicationController
|
|||
session.delete(ransack_session_key)
|
||||
elsif params[:remove_param]
|
||||
current_params = session[ransack_session_key] || {}
|
||||
updated_params = delete_search_param(current_params, params[:remove_param], value: params[:remove_param_value])
|
||||
if params[:remove_param] == "date_range"
|
||||
updated_params = current_params.except("date_gteq", "date_lteq")
|
||||
elsif params[:remove_param_value]
|
||||
key_to_remove = params[:remove_param]
|
||||
value_to_remove = params[:remove_param_value]
|
||||
updated_params = current_params.deep_dup
|
||||
updated_params[key_to_remove] = updated_params[key_to_remove] - [ value_to_remove ]
|
||||
else
|
||||
updated_params = current_params.except(params[:remove_param])
|
||||
end
|
||||
session[ransack_session_key] = updated_params
|
||||
elsif params[:q]
|
||||
session[ransack_session_key] = params[:q]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue