Last Updated: February 25, 2016
·
613
· mehulkar

Rails helper attributes

Interpolate in a rails helper attribute by using double quotes. Single quotes don't work.

E.g.

<%= v.text_field :name, id: "prefix_#{variable}" %>

vs.

<%= v.text_field :name, id: 'prefix_#{variable}' %>