app/helpers/vln_related_items_helper.rb
def link_to_view_all_related_items item, resources, authorized_resources, scale_title
    link = ""
    resource_type = resources.first.class.name
    count = authorized_resources.size
    tab_content_view_all = scale_title + '_' + resource_type + '_view_all'
    tab_content_view_some = scale_title + '_' + resource_type + '_view_some'
    ajax_link_to_view_in_current_window =
        link_to_with_callbacks "View all #{count} items here",
                               {:url => url_for(:action => 'related_items_tab_ajax'),
                                :method => "get",
                                :condition => "check_tab_content('#{tab_content_view_all}', '#{tab_content_view_some}')",
                                :with => "'resource_type=' + '#{resource_type}'
                                          +  '&scale_title=' + '#{scale_title}'
                                          +  '&view_type=' + 'view_all'
                                          +  '#{item ? '&item_id='+ item.id.to_s + '&item_type=' + item.class.name : ''}'",
                                :before => "$('#{tab_content_view_some}').hide();
                                                   $('#{tab_content_view_all}').show();
                                                   show_large_ajax_loader('#{tab_content_view_all}');"},
                               {:remote => true}

    link << ajax_link_to_view_in_current_window
    link << " || "
    link << link_to_view_all_in_new_window(item, resource_type)
    link.html_safe
  end
#Resource hash for lazy loaded tabs, key: resource_type, value: resource
#Each hash value
Resource hash for lazy loaded tabs, key: resource_type, value: resource
Each hash value
Resource hash for lazy loaded tabs key : resource_type value : resource Each hash value
def link_to_view_all_related_items item, resources, authorized_resources, scale_title
    link = ""
    resource_type = resources.first.class.name
    count = authorized_resources.size
    tab_content_view_all = scale_title + '_' + resource_type + '_view_all'
    tab_content_view_some = scale_title + '_' + resource_type + '_view_some'
    ajax_link_to_view_in_current_window =
        link_to_with_callbacks "View all #{count} items here",
                               {:url => url_for(:action => 'related_items_tab_ajax'),
                                :method => "get",
                                :condition => "check_tab_content('#{tab_content_view_all}', '#{tab_content_view_some}')",
                                :with => "'resource_type=' + '#{resource_type}'
                                          +  '&scale_title=' + '#{scale_title}'
                                          +  '&view_type=' + 'view_all'
                                          +  '#{item ? '&item_id='+ item.id.to_s + '&item_type=' + item.class.name : ''}'",
                                :before => "$('#{tab_content_view_some}').hide();
                                                   $('#{tab_content_view_all}').show();
                                                   show_large_ajax_loader('#{tab_content_view_all}');"},
                               {:remote => true}
    link << ajax_link_to_view_in_current_window
    link << " || "
    link << link_to_view_all_in_new_window(item, resource_type)
    link.html_safe
  end
def link_to_view_all_related_items item , resources , authorized_resources , scale_title link = "" resource_type = resources . first . class . name count = authorized_resources . size tab_content_view_all = scale_title + '_' + resource_type + '_view_all' tab_content_view_some = scale_title + '_' + resource_type + '_view_some' ajax_link_to_view_in_current_window = link_to_with_callbacks "View all #{count} items here" , { :url => url_for ( :action => 'related_items_tab_ajax' ) , :method => "get" , :condition => "check_tab_content('#{tab_content_view_all}', '#{tab_content_view_some}')" , :with => "'resource_type=' + '#{resource_type}'
                                          +  '&scale_title=' + '#{scale_title}'
                                          +  '&view_type=' + 'view_all'
                                          +  '#{item ? '&item_id='+ item.id.to_s + '&item_type=' + item.class.name : ''}'" , :before => "$('#{tab_content_view_some}').hide();
                                                   $('#{tab_content_view_all}').show();
                                                   show_large_ajax_loader('#{tab_content_view_all}');" } , { :remote => true } link << ajax_link_to_view_in_current_window link << " || " link << link_to_view_all_in_new_window ( item , resource_type ) link . html_safe end
Resource hash for lazy loaded tabs, key: resource_type, value: resource
Each hash value
Resource hash for lazy loaded tabs key : resource_type value : resource Each hash value
item
resources
authorized_resources
scale_title