Sha256: dc84df98933579240f1d65aff16f33b8bb9ea1d618403f83354f8c61aac2865d

Contents?: true

Size: 1.28 KB

Versions: 34

Compression:

Stored size: 1.28 KB

Contents

- unless defined? required
  - required = false
- if !(defined? id) || id.blank? 
  - id = "#{name}_#{rand(1000)}"
- unless defined? placeholder
  - placeholder = "Selecciona..."
- unless defined? clazz
  - clazz = nil
- unless defined? selected_elements
  - selected_elements = []
- if selected_elements.nil?
  - selected_elements = []
- selected_elements = selected_elements.collect { |element| element.to_s }

-if required
  .form-group.has-success
    label.fg-label #{placeholder}
    select.chosen id="#{id}" class="#{clazz}" name="#{name}[]" data-placeholder=("#{placeholder}") chosen="" multiple="" style=("display: none;") required=""
      -for element in elements
        -if selected_elements.include?(element[:value].to_s)
          option value="#{element[:value]}" selected="" #{element[:text]} 
        -else
          option value="#{element[:value]}" #{element[:text]} 
-else
  .form-group
    label.fg-label #{placeholder}
    select.chosen id="#{id}" name="#{name}[]" data-placeholder=("#{placeholder}") chosen="" multiple="" style=("display: none;")
      -for element in elements
        -if selected_elements.include?(element[:value].to_s)
          option value="#{element[:value]}" selected="" #{element[:text]} 
        -else
          option value="#{element[:value]}" #{element[:text]} 

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
sinatra-hexacta-0.9.5 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.9.4 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.9.3 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.9.2 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.9.1 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.9.0 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.8.8 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.8.7 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.8.6 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.8.5 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.8.4 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.8.3 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.8.1 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.8.0 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.7.2 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.7.1 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.7.0 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.6.1 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.6.0 lib/sinatra/views/inputs/multiple_select.slim
sinatra-hexacta-0.5.1 lib/sinatra/views/inputs/multiple_select.slim