Search code examples
ruby-on-railsformssimple-form

Add data-tooltip to simple form syntax?


this is one of the things I normally spend many hours trying many combinations, but today did not work.

I want to add Foundations data tooltip to a simple_form input, and I can't match the correct syntax.

Without simpleform:

data-tooltip class="has-tip" title="Borrar este spot definitivamente"

With simpleform:

:html => {:"data-tooltip" => 'class="has-tip"' 'title="Borrar este spot definitivamente"'}

Thanks


Solution

  • Try this

    <%= f.input :field_name, input_html: { "data-tooltip" => true, :class => "has-tip", :title => "Bla bla bla" } %>