Permalink
Browse files

Helper for facebook_like button

  • Loading branch information...
1 parent cd9471b commit 4f32a681a6d3c449aa268ed78cee94ac8209f574 Evan Sparkman committed Apr 11, 2012
Showing with 7 additions and 0 deletions.
  1. +2 −0 lib/schnitzelpress.rb
  2. +4 −0 lib/schnitzelpress/helpers.rb
  3. +1 −0 lib/views/post.haml
View
@@ -14,6 +14,8 @@
require 'active_support/core_ext/class'
require 'active_support/concern'
+require 'sinatra/ratpack'
+
require 'schnitzelpress/cache_control'
require 'schnitzelpress/env'
require 'schnitzelpress/static'
@@ -237,5 +237,9 @@ def link_to(title, target = "", options = {})
def link_to_delete_post(title, post)
link_to title, "/admin/edit/#{post.id}", :method => :delete, :confirm => "Are you sure? This can not be undone."
end
+
+ def facebook_like
+ content_for :iframe, nil, :src => "http://www.facebook.com/plugins/like.php?href=#{CGI::escape(request.url)}&layout=standard&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=80", :scrolling => 'no', :frameborder => '0', :allowtransparency => true, :id => :facebook_like
+ end
end
end
View
@@ -11,6 +11,7 @@
%li
%a{:href => post.to_url}= h post.title
+= facebook_like
- if show_disqus? && @post.disqus?
%section.disqus
= partial 'disqus', :disqus_identifier => @post.disqus_identifier

0 comments on commit 4f32a68

Please sign in to comment.