def genderize(word_m, subject, word_f = nil)
return word_m if male?(subject)
return word_f if word_f.present?
word_m + 'e'
end
private
def male?(subject)
subject.gender.casecmp('male') == 0
end#How to translate with a link in the translation
= t('terms.accept_html', company_name: agency.company_name, terms_link: link_to(t('terms.general_terms'), terms_path(type: 'agency', target: '_blank'))term:
accept_html: Je reconnais avoir lu et j’accepte au nom de la société %{company_name} %{terms_link} de Brand and Celebrities.
general_terms: les conditions générales de vente@user = User.new(name: '')
[...]
= text_field_tag :pseudo, nil, value: params[:pseudo] || @user.name
# doesn't work :'(
= text_field_tag :pseudo, nil, value: params[:pseudo].present? ? params[:pseudo] : @user.name.present?
# works, but ugly, x2 character count ! :'(Before
$ item = Project::Speaker.find(5)
$ item.class.name
> "Project::Speaker"
$ item.class.name.split('::').first
> "Project"
$ item.class.name.split('::').last
> "Speaker"scope = Celebrity.find(10).tweet
Celebrity Load (0.5ms) SELECT `celebrities`.* FROM `celebrities` WHERE `celebrities`.`id` = 10 LIMIT 1
Tweet Load (38.2ms) SELECT `tweets`.* FROM `tweets` WHERE `tweets`.`celebrity_id` = 10
!!! Toujour vérifier que chaque session microsoft est ouvert dans des instances indépendantes #sessionprivée !!!
Fichier inventaire : https://docs.google.com/a/brandandcelebrities.com/spreadsheets/d/1RIp039mt0Pgd7YODNY7fYUWzEjxUghwLOV_nl4OOPOQ/edit?usp=drive_web
Ajouter une nouvelle @ du type (ex : bc12_lo@brandandcelebrities.com)
Créer un alias de l'@ pour le groupe bcXX@brandandcelebrities.com (le xx représente le master).