문제

I am having some problem with some facebook share link on Middleman blog:-

Well I have :

<%= link_to current_article, article %>

=> <a href="http://0.0.0.0:4567/link_of_article">Article Title</a>

I am trying to have:-

<a class ="btn btn-primary" href="http://www.facebook.com/sharer.php?u=http://0.0.0.0:4567/link_to_title&text=Title of the Article Here" target="_blank"><i class="fa fa-facebook">Facebook Share</i></a>
도움이 되었습니까?

해결책

<%= link_to "http://www.facebook.com/sharer.php?u=" + article_url(article, :text => article.title), :class => "btn btn-primary" do %>
  <i class="fa fa-facebook">
    Facebook Share 
  </i>
<%end%>

I am assuming that current_article_url is http://0.0.0.0:4567/link_to_title

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top