Permalink
Browse files

url is not accessible for twitter, parameterize it

  • Loading branch information...
1 parent 6f9cf9c commit 7d2c4a5d759c8a587bfa1b6064d5ccd09a5ab18c @iffyuva committed Oct 13, 2012
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/social_buttons/view_helpers/tweet.rb
@@ -7,6 +7,7 @@ module Tweet
def tweet_button(options = {})
clazz = SocialButtons::Tweet
+ params.merge!(url: request.url)
params = clazz.options_to_data_params(clazz.default_options.merge(options))
params.merge!(class: CLASS)
@@ -19,7 +20,6 @@ def tweet_button(options = {})
class << self
def default_options
@default_options ||= {
- url: request.url,
via: "tweetbutton",
text: "",
count: "vertical",
@@ -30,14 +30,13 @@ def default_options
def script
return empty_content if widgetized?
- @widgetized = true
-
+ @widgetized = true
"<script src=#{twitter_wjs} type='text/javascript'></script>".html_safe
end
- def twitter_wjs
+ def twitter_wjs
"http://platform.twitter.com/widgets.js"
end
end # class
end
-end
+end

0 comments on commit 7d2c4a5

Please sign in to comment.