簡體   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