Skip to content

Commit

Permalink
Allows url with id to work in chargeback rates explorer
Browse files Browse the repository at this point in the history
This commit will allow direct url with id of rate to work in chargeback rates explorer
- http://localhost:3000/chargeback_rate/explorer/ (loads Rates explorer)
- http://localhost:3000/chargeback_rate/x_show/9  (loads summary screen of rate using id passed in the url)

Partially fixes #6996
  • Loading branch information
h-kataria committed May 11, 2020
1 parent 17af2ba commit 8ea91d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/controllers/chargeback_rate_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,22 @@ def x_show
params[:id] = "xx-#{@record.rate_type}_#{nodeid}"
params[:tree] = x_active_tree.to_s
tree_select
redirect_to :action => 'explorer' unless request.xml_http_request? # Ajax request means in explorer
end

def tree_select
self.x_active_tree = params[:tree] if params[:tree]
self.x_active_tree = :cb_rates_tree
self.x_node = params[:id]
get_node_info(x_node)
replace_right_cell
replace_right_cell if request.xml_http_request? # Ajax request means in explorer
end

def explorer
@breadcrumbs = []
@explorer = true
build_accordions_and_trees

@right_cell_text = _("All Chargeback Rates")
@right_cell_text ||= _("All Chargeback Rates")
set_form_locals if @in_a_form
session[:changed] = false

Expand Down
1 change: 1 addition & 0 deletions app/views/chargeback_rate/x_show.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
= render :partial => 'cb_rate_show'
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
:chargeback_rate => {
:get => %w(
explorer
x_show
),
:post => %w(
explorer
Expand Down

0 comments on commit 8ea91d4

Please sign in to comment.