Skip to content

Instantly share code, notes, and snippets.

@GesJeremie
Created September 3, 2015 20:59
Show Gist options
  • Select an option

  • Save GesJeremie/3328c14e0909d3827d74 to your computer and use it in GitHub Desktop.

Select an option

Save GesJeremie/3328c14e0909d3827d74 to your computer and use it in GitHub Desktop.
- @industries.each_with_index do |industry, index|
- if index == 0
.gray-box
Industry
= select_tag :industry, options_from_collection_for_select(@select_industries, "id", "title", industry[:id])
#subindustries
- else
%div{:class => "gray-box", :data => {:entry => ""}}
Sub-Industry
%select{:data => {:toggle => "change"}, :name => "subindustry[]"}
- industry[:choices].each do |choice|
- if industry[:id] == choice[:id]
%option{:value => choice.id, :selected => "selected"}
= choice.title
- else
%option{:value => choice.id}
= choice.title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment