so_cial 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +3 -3
- data/lib/so_cial/helper.rb +2 -1
- data/lib/so_cial/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# so_cial (So Social)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This gem adds atm. twitters sharebutton on your page
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ Or install it yourself as:
|
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
In your viewfile add <%= social_button_for(:twitter) %> to get the twitter sharebutton
|
|
22
22
|
|
|
23
23
|
## Contributing
|
|
24
24
|
|
data/lib/so_cial/helper.rb
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
module SoCial
|
|
3
3
|
module Helper
|
|
4
4
|
def social_button_for(service, opts = {})
|
|
5
|
+
data = opts[:data]
|
|
5
6
|
html = []
|
|
6
|
-
html << link_to('Tweet', 'https://twitter.com/share', class: 'twitter-share-button')
|
|
7
|
+
html << link_to('Tweet', 'https://twitter.com/share', class: 'twitter-share-button', data: data)
|
|
7
8
|
html << '<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>'
|
|
8
9
|
raw html.join("\n")
|
|
9
10
|
end
|
data/lib/so_cial/version.rb
CHANGED