Created
August 10, 2018 08:43
-
-
Save neudabei/9cf3efeb343bcdb7967aa51f2b83671a to your computer and use it in GitHub Desktop.
fl_medium_blogpost
This file contains 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 subject_category_interest_props | |
subject_categories = SubjectCategory.in_alphabetical_order | |
interested_subject_categories = current_user.interested_subject_categories | |
{ fields: | |
subject_categories.map do |sc| | |
selected = interested_subject_categories.include?(sc) | |
{ title: sc.title, value: sc.id.to_s, selected: selected } | |
end } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment