app/helpers/application_helper.rb
# Create a collapsed panel based on a condition
Create a collapsed panel based on a condition
Create a collapsed panel based on a condition
def miq_accordion_panel(title, condition, id, &block)
    content_tag(:div, :class => "panel panel-default") do
      out = content_tag(:div, :class => "panel-heading") do
        content_tag(:h4, :class => "panel-title") do
          link_to(title, "##{id}",
                  'data-parent' => '#accordion',
                  'data-toggle' => 'collapse',
                  :class        => condition ? '' : 'collapsed')
        end
      end
      out << content_tag(:div, :id => id, :class => "panel-collapse collapse #{condition ? 'in' : ''}") do
        content_tag(:div, :class => "panel-body", &block)
      end
    end
  end
def miq_accordion_panel ( title , condition , id , & block ) content_tag ( :div , :class => "panel panel-default" ) do out = content_tag ( :div , :class => "panel-heading" ) do content_tag ( :h4 , :class => "panel-title" ) do link_to ( title , "##{id}" , 'data-parent' => '#accordion' , 'data-toggle' => 'collapse' , :class => condition ? '' : 'collapsed' ) end end out << content_tag ( :div , :id => id , :class => "panel-collapse collapse #{condition ? 'in' : ''}" ) do content_tag ( :div , :class => "panel-body" , & block ) end end end
Create a collapsed panel based on a condition
Create a collapsed panel based on a condition
title
<not_specific>
condition
<not_specific>
id
<not_specific>
block
<not_specific>