I want to display a text box with some JSON in its data attribute. That's what I'm doing
<%= f.text_field :time, "data-options" => '{"mode": "timebox"}' %>
but it displays the following HTML
<input data-options="{"mode": "timebox"}" ...
I want to reach
<input data-options='{"mode": "timebox"}' ...
I want it to include the attribute in single quotes, without leaving the content. Can I do this with the text_field helper?
source
share