Skip to content

Commit 0233b99

Browse files
Fix pr issues
1 parent d71c57c commit 0233b99

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

app/controllers/mixins/checked_id_mixin.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ def checked_item_id(hash = params)
1010
# Common routine to find checked items on a page (checkbox ids are
1111
# "check_xxx" where xxx is the item id or index)
1212
def find_checked_items(prefix = nil)
13-
# If id is present use id, example on summary pages
14-
if params[:id].present?
13+
nested_list_item_string = ""
14+
# Check if nested list items are tagged.
15+
if params["miq_grid_checks"].present?
16+
nested_list_item = params["miq_grid_checks"].split(",")[0]
17+
18+
# Create param string
19+
nested_list_item_string = "select-row-#{nested_list_item}"
20+
end
21+
22+
# If id is present use id, unless when nested list exists, example on summary pages
23+
if params[:id].present? && params[nested_list_item_string] != "on"
1524
[params[:id]]
1625
elsif params[:miq_grid_checks].present?
1726
params[:miq_grid_checks].split(",").collect(&:to_i)

0 commit comments

Comments
 (0)