Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 任何谷歌+;1个按钮用于轨道?_Ruby On Rails_Ruby On Rails 3_Gem_Google Plus One - Fatal编程技术网

Ruby on rails 任何谷歌+;1个按钮用于轨道?

Ruby on rails 任何谷歌+;1个按钮用于轨道?,ruby-on-rails,ruby-on-rails-3,gem,google-plus-one,Ruby On Rails,Ruby On Rails 3,Gem,Google Plus One,在rails应用程序中,是否有可以将google+1按钮插入网页的gem 如果没有,是否有添加按钮的特殊“rails方式” 任何可以在rails应用程序中将google+1按钮插入网页的gem 没有 添加按钮的一些特殊“rails方式” 没有 只需使用谷歌提供的代码。它是添加到标记中的单个标记,以及使其工作的几行脚本。几乎不值得珍视: <g:plusone annotation="inline"></g:plusone> <script type="text/ja

在rails应用程序中,是否有可以将google+1按钮插入网页的gem

如果没有,是否有添加按钮的特殊“rails方式”

任何可以在rails应用程序中将google+1按钮插入网页的gem

没有

添加按钮的一些特殊“rails方式”

没有

只需使用谷歌提供的代码。它是添加到标记中的单个标记,以及使其工作的几行脚本。几乎不值得珍视:

<g:plusone annotation="inline"></g:plusone>

<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

(功能(){
var po=document.createElement('script');po.type='text/javascript';po.async=true;
po.src=https://apis.google.com/js/plusone.js';
var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(po,s);
})();

请参见。

提供Twitter/Facebook/Google+/Pinterest按钮。

但是有自定义代码片段。选择将数据放在头部或身体等…你所说的都不是宝石。只需在视图中插入标记。您知道,输入锚标记也不是什么大问题,但是
link\u to
helper非常有用。好的,不懂,谢谢:)链接到
之间有很大的区别。Google+按钮是一个永远不会改变的静态字符串。在gem/helper中,没有必要每次都输出相同的静态字符串。据我所知,代码段应该是动态的!谢谢你的回答!