简体   繁体   English

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

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

Without adjusting the length in yaml how can I take this line of code down: 在不调整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))

Also...how do I deal with: Use new Ruby 1.9 hash syntax? 另外...我该如何处理:使用新的Ruby 1.9哈希语法?

I know it's erroring with the :allow_sites => but when I change it to: 我知道:allow_sites =>出错了,但是当我将其更改为:

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

It actually will not display twitter and pinterest. 它实际上不会显示twitter和pinterest。 It's kind of crazy. 这有点疯狂。

I had used this gem. 我用过这个宝石。 You can use like the below: 您可以像下面这样使用:

在此处输入图片说明

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

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