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 social

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

  1. Fork it ( http://github.com//social/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request