繁体   English   中英

Rubocop行太长,请使用新的Ruby 1.9哈希语法

[英]Rubocop line is too long and Use new Ruby 1.9 hash syntax

在不调整yaml长度的情况下,如何删除此行代码:

social_share_button_tag(@post.title, desc: '@post.title', image: ' @post.avatar(:medium)', :allow_sites => %w(twitter facebook google_plus linkedin pinterest), url: tiny_post_url(@post.url_name))

另外...我该如何处理:使用新的Ruby 1.9哈希语法?

我知道:allow_sites =>出错了,但是当我将其更改为:

allow_sites: %w'(twitter facebook google_plus linkedin pinterest)' 

它实际上不会显示twitter和pinterest。 这有点疯狂。

我用过这个宝石。 您可以像下面这样使用:

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM