Class: Sirens::NamespacesList

Inherits:
Component show all
Defined in:
lib/sirens/components/namespaces_list.rb

Instance Method Summary collapse

Methods inherited from Component

#build, #create_view, #initialize, #main_child_component, #on_component_added, #open

Methods inherited from AbstractComponent

#add_all_components, #add_component, #child_components, #create_view, #default_model, #initialize, #model, #on_component_added, #on_model_changed, open, #props, #remove_component_at, #remove_last_component, #set_model, #set_props, #view

Constructor Details

This class inherits a constructor from Sirens::Component

Instance Method Details

#render_with(layout) ⇒ Object

Building



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sirens/components/namespaces_list.rb', line 6

def render_with(layout)
    layout.render do |component|

        choices_tree do
            model component.model

            styles show_headers: true

            column label: '',
                get_image_block: proc{ |a_module| Icons.icon_for(a_module) }

            column label: 'Namespaces',
                get_text_block: proc{ |a_module| a_module.name }
        end

    end
end