Sha256: ae73e6f1bab8d633b31fd1fcee4e457d90f079c74d6bd3d54d027480d7864419

Contents?: true

Size: 730 Bytes

Versions: 1

Compression:

Stored size: 730 Bytes

Contents

- selection_options = element.options.delete(:options)
- value = element.options.delete(:value) || ''
- content = element.content

%label= element.label
- if element.has_class? 'required'
  %span.required *

%select{element.options}
  - if selection_options.instance_of Hash
    - selection_options.each_pair do |option_name, option_value|
      - selected  = value && option_value == value
      %option{:value => option_value, :selected => selected}= option_name

  - elsif selection_options.instance_of Array
    - selection_options.each do | option_name |
      - selected  = value && option_value == value
      %option{:value => option_value, :selected => selected}= option_value

  =capture_haml &content if !content.nil?

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
formic-0.2.5 views/formic/default/_selection.html.haml