Module: Tramway::AdditionalButtonsBuilder

Defined in:
app/helpers/tramway/additional_buttons_builder.rb

Instance Method Summary collapse

Instance Method Details

#build_button(button) ⇒ Object



4
5
6
7
8
9
10
11
# File 'app/helpers/tramway/additional_buttons_builder.rb', line 4

def build_button(button)
  options = button[:options] || {}
  style = 'margin-right: 8px'
  concat(link_to(button[:url], method: button[:method], class: "btn btn-#{button[:color]} btn-xs", style: style,
                               **options) do
           button[:inner]&.call
         end)
end