Search code examples
ruby-on-railsslim-lang

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)


Solution

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

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