Skip to content

Commit 506dc5c

Browse files
committed
Facebook SDK
1 parent 3c119dd commit 506dc5c

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ gem 'bootstrap-sass'
3030
gem 'virtus'
3131
gem 'octokit'
3232

33+
gem 'dotenv-rails', :groups => [:development, :test]
34+
3335

3436
# Omniauth Gems #
3537
gem 'omniauth-facebook'

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ GEM
7575
debug_inspector (0.0.2)
7676
descendants_tracker (0.0.4)
7777
thread_safe (~> 0.3, >= 0.3.1)
78+
dotenv (2.1.1)
79+
dotenv-rails (2.1.1)
80+
dotenv (= 2.1.1)
81+
railties (>= 4.0, < 5.1)
7882
equalizer (0.0.11)
7983
erubis (2.7.0)
8084
execjs (2.7.0)
@@ -231,6 +235,7 @@ DEPENDENCIES
231235
bootstrap-sass
232236
bootstrap_form
233237
coffee-rails (~> 4.1.0)
238+
dotenv-rails
234239
jbuilder (~> 2.0)
235240
jquery-rails
236241
kaminari

app/views/layouts/_header.html.erb

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,22 @@
3939
<h4>Logged In with -> <strong><em><%= @auth['provider'].capitalize %></em></strong></h4>
4040
<%= image_tag('logo.png') %>
4141
</div>
42-
<% end %>
42+
<% end %>
43+
44+
<script>
45+
window.fbAsyncInit = function() {
46+
FB.init({
47+
appId : '295017477501220',
48+
xfbml : true,
49+
version : 'v2.6'
50+
});
51+
};
52+
53+
(function(d, s, id){
54+
var js, fjs = d.getElementsByTagName(s)[0];
55+
if (d.getElementById(id)) {return;}
56+
js = d.createElement(s); js.id = id;
57+
js.src = "//connect.facebook.net/en_US/sdk.js";
58+
fjs.parentNode.insertBefore(js, fjs);
59+
}(document, 'script', 'facebook-jssdk'));
60+
</script>

0 commit comments

Comments
 (0)