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}' %>
Written by Mehul Kar
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#