Browse files

Add a facebook like button on top page.

  • Loading branch information...
1 parent 6a96908 commit 219765f171ab16fe5e1216864e06e47dfd4fffcc @volpe28v committed Apr 9, 2012
Showing with 16 additions and 0 deletions.
  1. +4 −0 app/helpers/application_helper.rb
  2. +11 −0 app/views/layouts/application.html.erb
  3. +1 −0 app/views/welcome/index.html.erb
View
4 app/helpers/application_helper.rb
@@ -1,2 +1,6 @@
module ApplicationHelper
+ def fb_like(url)
+ raw ('<div class="fb-like" data-href="' + url + '" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false" data-font="arial"></div>')
+ end
+
end
View
11 app/views/layouts/application.html.erb
@@ -25,6 +25,17 @@
</script>
</head>
<body>
+
+<div id="fb-root"></div>
+<script>(function(d, s, id) {
+ var js, fjs = d.getElementsByTagName(s)[0];
+ if (d.getElementById(id)) return;
+ js = d.createElement(s); js.id = id;
+ js.src = "//connect.facebook.net/ja_JP/all.js#xfbml=1&appId=406190552742799";
+ fjs.parentNode.insertBefore(js, fjs);
+ }(document, 'script', 'facebook-jssdk'));
+</script>
+
<div id="wrapper">
<header>
<div class="logo">
View
1 app/views/welcome/index.html.erb
@@ -31,6 +31,7 @@
<li>ユーザ間のコミュニケーション機能</li>
</ul>
+ <%= fb_like("http://kotaren.heroku.com/") %>
<hr>
<h1>人気曲Top10</h1>
<table>

0 comments on commit 219765f

Please sign in to comment.