Skip to content

Instantly share code, notes, and snippets.

@brentsowers1
Created March 6, 2014 02:33
Show Gist options
  • Save brentsowers1/9381127 to your computer and use it in GitHub Desktop.
Save brentsowers1/9381127 to your computer and use it in GitHub Desktop.
/lib/facebooker/rails/helpers.rb
module Facebooker
def self.api_key
unless @_api_key
config = (YAML.load(ERB.new(File.read(File.join(::Rails.root,"config","facebooker.yml"))).result)[::Rails.env])
@_api_key = config["api_key"]
end
@_api_key
end
...
# Return the URL for the about page of the application
def fb_about_url
"http://www.facebook.com/apps/application.php?api_key=#{Facebooker.api_key}"
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment