Class: Sirens::ConstantsList

Inherits:
Component show all
Defined in:
lib/sirens/components/constants_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



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

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

            styles(
                show_headers: false
            )

            column label: 'Constants',
                get_text_block: proc{ |constant| constant.display_string }
        end
    end
end