class Playbook::PbTable::TableHeader
def next_link(sort_item: "")
def next_link(sort_item: "") sort_menu_for = if sort_item.blank? sort_menu else sort_items_for(sort_item) end return sort_menu_for[0][:link] if sort_menu_for.all? { |item| item[:active] == false } link = "" sort_menu_for.each_with_index do |item, index| if item[:active] == true next_index = (index + 1) % sort_menu_for.length link = sort_menu_for[next_index][:link] end end link end