开发者

Gravatar Imager Url not Working - Rails

开发者 https://www.devze.com 2023-02-03 10:35 出处:网络
I\'m using a gem called \'img_gravatar\' to get avatars for my users profiles. The syntax is as follows:

I'm using a gem called 'img_gravatar' to get avatars for my users profiles. The syntax is as follows:

img_gravtar(@user.email)

Which outputs

<img src="http://www.gravatar.com/avatar/747fb50017944a3开发者_开发知识库ca06b77fc2d51ba3b" />

The output is an img tag the works, but the tag is just displayed as text in the browser. How can I fix this?


I would bet you are in Rails3, and the output is escaped HTML.

try

img_gravtar(@user.email).html_safe
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号