Search code examples
ruby-on-railsrubocop

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:

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?

I know it's erroring with the :allow_sites => but when I change it to:

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

It actually will not display twitter and pinterest. It's kind of crazy.


Solution

  • I had used this gem. You can use like the below:

    enter image description here