Skip to content

Instantly share code, notes, and snippets.

@wowremywang
Created November 17, 2021 09:23
Show Gist options
  • Save wowremywang/a90e8aef4fd48c9b5dddffac2ddf9ee1 to your computer and use it in GitHub Desktop.
Save wowremywang/a90e8aef4fd48c9b5dddffac2ddf9ee1 to your computer and use it in GitHub Desktop.
Form Helpers
# Add data attribute to option
<%= select_tag :addon, options_for_select(@addons.map {|d| [d.name, d.sku, {'data-addon' => d.sku.downcase }]}) %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment