Ilia Aptsiauri Ilia Aptsiauri - 4 months ago 10
Ruby Question

how can I render datalist tag with slim-lang

To render views in the Ruby on Rails application I am using slim-lang, in one of my views I would like to have the

<datalist>
tag, with pre-field options how this will be possible with slim-lang.

UPDATE

= datalist :languages, options_for_select(@languages)

Answer

Slim will simply convert whatever you pass to HTML, have you tried:

datalist#browsers
  - ["Internet Explorer", "Firefox"].each do |browser|
    option value=browser