Permalink
Browse files

Adds gon gem just for testing purposes

  • Loading branch information...
1 parent a950a27 commit 93949cf03220e040c802905aae207ae860aaa131 Javier Fonseca V committed Nov 23, 2012
View
@@ -24,6 +24,7 @@ end
gem 'jquery-rails'
gem 'pg', '0.14.1'
+gem 'gon', '4.0.1'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
View
@@ -46,6 +46,9 @@ GEM
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
+ gon (4.0.1)
+ actionpack (>= 2.3.0)
+ json
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
@@ -118,6 +121,7 @@ PLATFORMS
DEPENDENCIES
coffee-rails (~> 3.2.1)
devise (= 2.1.2)
+ gon (= 4.0.1)
jquery-rails
pg (= 0.14.1)
rails (= 3.2.2)
@@ -1,3 +1,10 @@
class ApplicationController < ActionController::Base
protect_from_forgery
+
+ def load_facebook_client_side_config
+ facebook_config = {} # JUST FOR TESTING GON... should be global and loaded in some initializer
+ facebook_config[Rails.env] = {:app_id => "this is just a test for gon"}
+ gon.facebook_config = facebook_config[Rails.env]
+ end
+
end
@@ -1,5 +1,6 @@
class PostsController < ApplicationController
before_filter :authenticate_user!, :except => [:index, :show]
+ before_filter :load_facebook_client_side_config, :only => [:show]
def index
@posts = Post.order("created_at DESC")
@@ -3,6 +3,7 @@
<head>
<title>MyBlog</title>
<%= stylesheet_link_tag "application", :media => "all" %>
+ <%= include_gon %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>

0 comments on commit 93949cf

Please sign in to comment.