Social
TODO: Write a gem description
Installation
Add this line to your application's Gemfile:
gem 'social'
And then execute:
$ bundle
Or install it yourself as:
$ gem install
Usage
$ bundle exec rails social:install
Then go to your generated model (SocialEngagement) and add this line:
$ include Social::Model
You can now include Social::Engageable
in any model you want to track (Note: these models need to have routes for show).
If you want to use this in a rails engine you don't need to run the generator, just include Social::Engageable in the models you want to track.
Missing host
In order to generate urls for models, the server needs to know the host. Rails will know the host when serving web requests. If you need to get the social engagement outside of a web request (e.g. cron job) you need to specify the server host in the rails config.
Contributing
- Fork it ( http://github.com/
/social/fork ) - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request