app/helpers/vln_related_items_helper.rb
#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 ajax_link_to_view_limited_related_items item, resources, scale_title, limit
    resource_type = resources.first.class.name
    tab_content_view_all = scale_title + '_' + resource_type + '_view_all'
    tab_content_view_some = scale_title + '_' + resource_type + '_view_some'
    link =
        link_to_with_callbacks "View only " + limit.to_s + " items",
                               {:url => url_for(:action => 'related_items_tab_ajax'),
                                :method => "get",
                                :condition => "check_tab_content('#{tab_content_view_some}', '#{tab_content_view_all}')",
                                :with => "'resource_type=' + '#{resource_type}'
                                                                         +  '&scale_title=' + '#{scale_title}'
                                                                         +  '&view_type=' + 'view_some'
                                                                         +  '#{item ? '&item_id='+ item.id.to_s + '&item_type=' + item.class.name : ''}'",
                                :before => "$('#{tab_content_view_all}').hide();
                                               $('#{tab_content_view_some}').show();
                                               show_large_ajax_loader('#{tab_content_view_some}');"},
                               {:remote => true}
    link.html_safe
  end
def ajax_link_to_view_limited_related_items item , resources , scale_title , limit resource_type = resources . first . class . name tab_content_view_all = scale_title + '_' + resource_type + '_view_all' tab_content_view_some = scale_title + '_' + resource_type + '_view_some' link = link_to_with_callbacks "View only " + limit . to_s + " items" , { :url => url_for ( :action => 'related_items_tab_ajax' ) , :method => "get" , :condition => "check_tab_content('#{tab_content_view_some}', '#{tab_content_view_all}')" , :with => "'resource_type=' + '#{resource_type}'
                                                                         +  '&scale_title=' + '#{scale_title}'
                                                                         +  '&view_type=' + 'view_some'
                                                                         +  '#{item ? '&item_id='+ item.id.to_s + '&item_type=' + item.class.name : ''}'" , :before => "$('#{tab_content_view_all}').hide();
                                               $('#{tab_content_view_some}').show();
                                               show_large_ajax_loader('#{tab_content_view_some}');" } , { :remote => true } 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
scale_title
limit