Skip to content

Instantly share code, notes, and snippets.

View richjdsmith's full-sized avatar

Rich Smith richjdsmith

View GitHub Profile
@richjdsmith
richjdsmith / share_on_social.html.erb
Created January 25, 2019 14:15
Rails Share on Social Media Links No Javascript
<div class="flex">
<%= link_to "https://www.linkedin.com/shareArticle?mini=true&url=#{request.original_url}&title=#{@post.title.gsub(/\s+/, "%20")}&summary=#{@post.description.gsub(/\s+/, "%20")}", target: '_blank', rel: 'noopener', alt: 'Share on LinkedIn', class: 'no-underline mr-1 text-indigo-dark hover:text-indigo-light' do %>
<%= inline_svg('images/linkedin_share_icon.svg', class: 'h-8 w-8 fill-current ', title: 'Share on LinkedIn', width: '100%', height: '100%') %>
<% end %>
<%= link_to "http://twitter.com/share?text=I found this great article: #{@post.title}&url=#{request.original_url}&hashtags=thegoodvine", target: '_blank', rel: 'noopener', alt: 'Share on Twitter', class: 'no-underline mx-1 text-indigo-dark hover:text-indigo-light' do %>
<%= inline_svg('images/twitter_share_icon.svg', class: 'h-8 w-8 fill-current ', title:'Share on Twitter', width: '100%', height: '100%') %>
<% end %>
<%= link_to "https://www.facebook.com/dialog/share?app_id=#{Rails.application.credent