app/helpers/application_helper.rb
# Returns a LI tag for displaying an entry in a toolbar menu, given the parameters.
#
# == Params:
# - controller_params => the +params+ Hash from the current controller instance
# - action_name => the string name of the link action
# - label_text  => the label text to be displayed on the tab
# - action_path => the action path to be invoked upon clicking; pass a '#'
#                  to automatically disable the action (also with styles)
#
# - link_to_params => hash of params for link_to
# - force_active   => +true+ to force the tab active as default
#
Returns a LI tag for displaying an entry in a toolbar menu, given the parameters.
Params:
controller_params => the +params+ Hash from the current controller instance
action_name => the string name of the link action
label_text  => the label text to be displayed on the tab
action_path => the action path to be invoked upon clicking; pass a '#'
to automatically disable the action (also with styles)

link_to_params => hash of params for link_to
force_active   => +true+ to force the tab active as default
Returns a LI tag for displaying an entry in a toolbar menu given the parameters . Params : controller_params = > the + params + Hash from the current controller instance action_name = > the string name of the link action label_text = > the label text to be displayed on the tab action_path = > the action path to be invoked upon clicking ; pass a ' # ' to automatically disable the action ( also with styles ) link_to_params = > hash of params for link_to force_active = > + true + to force the tab active as default
def show_tab_link( controller_params, action_name, label_text, action_path, link_params = nil, force_active = false )
    if ( controller_params[:action] == action_name or force_active )
      content_tag( :li, class: 'active' ) do
        link_to( label_text, '#', {'data-turbolinks'=>'false'}.merge!( link_params.to_h ) )
      end
    else
      if action_path == '#'
        content_tag( :li, class: 'disabled', 'data-turbolinks'=>'false', 'data-toggle' => 'tooltip', 'title' => I18n.t(:login_to_view_this_data) ) do
          link_to( label_text, action_path, link_params )
        end
      else
        content_tag( :li ) do
          link_to( label_text, action_path, link_params )
        end
      end
    end
  end
def show_tab_link ( controller_params , action_name , label_text , action_path , link_params = nil , force_active = false ) if ( controller_params [ :action ] == action_name or force_active ) content_tag ( :li , class : 'active' ) do link_to ( label_text , '#' , { 'data-turbolinks' => 'false' } . merge! ( link_params . to_h ) ) end else if action_path == '#' content_tag ( :li , class : 'disabled' , 'data-turbolinks' => 'false' , 'data-toggle' => 'tooltip' , 'title' => I18n . t ( :login_to_view_this_data ) ) do link_to ( label_text , action_path , link_params ) end else content_tag ( :li ) do link_to ( label_text , action_path , link_params ) end end end end
Returns a LI tag for displaying an entry in a toolbar menu, given the parameters.
Returns a LI tag for displaying an entry in a toolbar menu given the parameters .
# If the path specified is a null anchor, we'll assume some of the required # data is missing or protected behind login:
controller_params
<not_specific>
action_name
<not_specific>
label_text
<not_specific>
action_path
<not_specific>
link_params
<not_specific>
force_active
<not_specific>