Last active
December 16, 2015 17:09
-
-
Save atleastimtrying/5468463 to your computer and use it in GitHub Desktop.
Drying this up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def regions_with_country_ids_for_select(collection) | |
response = [] | |
collection.each do |item| | |
response << [item.name, item.id, :"data-parent_id" => region.country_id] | |
end | |
response | |
end | |
def referral_origins_for_select(collection) | |
response = [] | |
collection.each do |item| | |
response << [item.name, item.id, :"data-parent_id" => referral_origin.referral_id] | |
end | |
response | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dependent_options(collection, label) | |
response = [] | |
collection.each do |item| | |
response << [item.name, item.id, :"data-parent_id" => item[label]] | |
end | |
response | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment