Rails a / an inflector

时间:2017-12-06 21:07:53

标签: ruby-on-rails helpers view-helpers inflector

是否有内置的Rails转换器用于确定单词是否以元音开头?我有这个(HAML):

  -if @user.aquire_deploy_text.match /^[aeiou]/i
    an
  -else
    a
  #{@user.aquire_deploy_text}.

文档:http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html

0 个答案:

没有答案