如何根据用户性别和资产风格设置Paperclip:default_url?

通过这个gist脚本,我可以获得具有用户性别的回形针的默认URL。 但我想得到:风格也是如此。 有人知道怎么做?

默认方式:

#Assuming you default images are stored in app/assets/images/somedirectory has_attached_file :attachment, default_url: :some_function def some_function "somedirectory/:style/:class/#{self.gender}.png" end 

或使用lambda:

 has_attached_file :attachment, default_url: lambda{|attachment| "somedirectory/:style/:class/#{attachment.instance.gender}.png" } 

在Rails中测试4。