Created
July 16, 2009 12:24
-
-
Save mallain/148386 to your computer and use it in GitHub Desktop.
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
UserProfile Model | |
xapit do |index| | |
index.text :first_name, :last_name | |
index.facet :diploma_skill | |
index.facet :trainings_translation_title | |
index.facet :first_name | |
index.facet :last_name | |
end | |
def trainings_translation_title | |
# Instanciation variables | |
array = Array.new | |
self.trainings.each do |x| | |
training_translations = TrainingTranslation.find_by_training_id(x.id) | |
array.push(training_translations.title) | |
end | |
return array | |
end | |
def diploma_skill | |
# Instanciation variables | |
array = Array.new | |
self.trainings.each do |x| | |
unless x.diploma_level_id.nil? | |
skill = SkillLevel.find(x.diploma_level_id) | |
# Recuperation des translations associes | |
skilltranslations = SkillLevelTranslation.find_by_skill_level_id(skill.id) | |
# Ajout dans le tableau | |
array.push(skilltranslations.name) | |
end | |
end | |
return array | |
end | |
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
<% @facets = UserProfile.search("*").facets%> | |
<% for facet in @facets %> | |
<%= facet.name %> | |
<% for option in facet.options %> | |
<%= link_to option.name, :overwrite_params => { :facets => option } %> | |
(<%= option.count %>) | |
<% end %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment